Resident Of Prey
Resident Of Prey
Explore posts from servers
SIASapphire - Imagine a framework
Created by Resident Of Prey on 10/11/2023 in #discordjs-support
help needed regarding prefix handler
hey i have (tried) to make a prefix command handler for my bot, down is my code for it, the bot boots up normally but idk why it doesn't react to the commands messageCreate.js handlePrefixes.js pingPrefix.js
5 replies
SIASapphire - Imagine a framework
Created by Resident Of Prey on 9/12/2023 in #discordjs-support
problems submitting modals
const { ModalBuilder, TextInputBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, PermissionsBitField, TextInputStyle } = require("discord.js");
const Fighter = require(`../../schemas/users`);
const mongoose = require('mongoose');

module.exports = {
data: {
name: 'randomOne'
},
async execute(interaction, client) {

const modal = new ModalBuilder()
.setCustomId("registerOne")
.setTitle("Register Yourself");

const textInput = new TextInputBuilder()
.setCustomId("in-game-name")
.setLabel("In-Game Name")
.setPlaceholder("Enter your in-game name")
.setRequired(true)
.setStyle(TextInputStyle.Short);

const one = new ActionRowBuilder().addComponents(textInput);

modal.addComponents(one, two, three);

await interaction.showModal(modal);

interaction.client.on("modalResponse", async (modalInteraction) => {
if (modalInteraction.customId === "registerOne") {
const inGameName = modalInteraction.fields.getTextInputValue("in-game-name");

await interaction.followUp({
content: `Your In-Game Name: ${inGameName}`,
ephemeral: true
});
}
});
},
};
const { ModalBuilder, TextInputBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, PermissionsBitField, TextInputStyle } = require("discord.js");
const Fighter = require(`../../schemas/users`);
const mongoose = require('mongoose');

module.exports = {
data: {
name: 'randomOne'
},
async execute(interaction, client) {

const modal = new ModalBuilder()
.setCustomId("registerOne")
.setTitle("Register Yourself");

const textInput = new TextInputBuilder()
.setCustomId("in-game-name")
.setLabel("In-Game Name")
.setPlaceholder("Enter your in-game name")
.setRequired(true)
.setStyle(TextInputStyle.Short);

const one = new ActionRowBuilder().addComponents(textInput);

modal.addComponents(one, two, three);

await interaction.showModal(modal);

interaction.client.on("modalResponse", async (modalInteraction) => {
if (modalInteraction.customId === "registerOne") {
const inGameName = modalInteraction.fields.getTextInputValue("in-game-name");

await interaction.followUp({
content: `Your In-Game Name: ${inGameName}`,
ephemeral: true
});
}
});
},
};
when i fill my details in the modal, it says something went wrong...
8 replies