Dannyxz
Dannyxz
DIAdiscord.js - Imagine an app
Created by Dannyxz on 3/1/2023 in #djs-questions
menu's
works now thanks
9 replies
DIAdiscord.js - Imagine an app
Created by Dannyxz on 3/1/2023 in #djs-questions
menu's
did interaction.update and removed the deferReply()
9 replies
DIAdiscord.js - Imagine an app
Created by Dannyxz on 3/1/2023 in #djs-questions
menu's
client.on(Events.InteractionCreate, async (interaction) => {
if (!interaction.isStringSelectMenu()) return;

if (interaction.customId === "select") {
let choices = "";

await interaction.deferReply();

await interaction.values.forEach(async (value) => {
choices += `${value}`;
});

await interaction.editReply({ content: `${choices}` });
}
});
client.on(Events.InteractionCreate, async (interaction) => {
if (!interaction.isStringSelectMenu()) return;

if (interaction.customId === "select") {
let choices = "";

await interaction.deferReply();

await interaction.values.forEach(async (value) => {
choices += `${value}`;
});

await interaction.editReply({ content: `${choices}` });
}
});
9 replies
DIAdiscord.js - Imagine an app
Created by Dannyxz on 3/1/2023 in #djs-questions
menu's
const {
SlashCommandBuilder,
EmbedBuilder,
ActionRowBuilder,
StringSelectMenuBuilder,
} = require("discord.js");

module.exports = {
data: new SlashCommandBuilder()
.setName(`selectmenu`)
.setDescription(`This is a select menu`),
async execute(interaction) {
const menu = new ActionRowBuilder().addComponents(
new StringSelectMenuBuilder()
.setCustomId("select")
.setMaxValues(1) // Updated to allow only one option to be selected
.setPlaceholder("Nothing Selected")
.addOptions(
{
label: "1st option",
description: "This is the first description",
value: "option 1",
},
{
label: "2st option",
description: "This is the second description",
value: "option 2",
}
)
);
await interaction.deferReply();
const message = await interaction.editReply({
content: "This is a select menu!",
components: [menu],
});

return message;
},
};
const {
SlashCommandBuilder,
EmbedBuilder,
ActionRowBuilder,
StringSelectMenuBuilder,
} = require("discord.js");

module.exports = {
data: new SlashCommandBuilder()
.setName(`selectmenu`)
.setDescription(`This is a select menu`),
async execute(interaction) {
const menu = new ActionRowBuilder().addComponents(
new StringSelectMenuBuilder()
.setCustomId("select")
.setMaxValues(1) // Updated to allow only one option to be selected
.setPlaceholder("Nothing Selected")
.addOptions(
{
label: "1st option",
description: "This is the first description",
value: "option 1",
},
{
label: "2st option",
description: "This is the second description",
value: "option 2",
}
)
);
await interaction.deferReply();
const message = await interaction.editReply({
content: "This is a select menu!",
components: [menu],
});

return message;
},
};
9 replies
DIAdiscord.js - Imagine an app
Created by Dannyxz on 2/13/2023 in #djs-questions
cooldown added to command not working
ah thanks, btw do you know any videos related DB as its not my best thing as you can see. Just asking if you got any docs or youtube videos you know that I can use. If not then that's okay, thanks for your time
4 replies