Mountwolf
Mountwolf
DIAdiscord.js - Imagine an app
Created by Mountwolf on 1/30/2024 in #djs-questions
Dynamically adding buttons component to interaction
Ty
13 replies
DIAdiscord.js - Imagine an app
Created by Mountwolf on 1/30/2024 in #djs-questions
Dynamically adding buttons component to interaction
Thank alot i tried it now with 5 buttons and it works now, will a a second row now
13 replies
DIAdiscord.js - Imagine an app
Created by Mountwolf on 1/30/2024 in #djs-questions
Dynamically adding buttons component to interaction
How would I add a second row
13 replies
DIAdiscord.js - Imagine an app
Created by Mountwolf on 1/30/2024 in #djs-questions
Dynamically adding buttons component to interaction
Oh so is not possible to have more than 5 buttons
13 replies
DIAdiscord.js - Imagine an app
Created by Mountwolf on 1/30/2024 in #djs-questions
Dynamically adding buttons component to interaction
This is my code
13 replies
DIAdiscord.js - Imagine an app
Created by Mountwolf on 1/30/2024 in #djs-questions
Dynamically adding buttons component to interaction
const lines = body.split("\n");
buttons = new Array();

console.log("ButtonPrimary ", body);
for (let index = 0; index < lines.length; index++) {

const element = lines[index].trim();
if (element == "") continue;

this["ViewButton"+index] = new ButtonBuilder()
.setLabel(element)
.setStyle(ButtonStyle.Primary)
.setCustomId(element);

buttons.push(this["ViewButton"+index]);
}

const buttonRow = new ActionRowBuilder().addComponents(buttons);

const reply = await interaction.editReply({content: "View summary", components: [buttonRow]});
const filter = (i) => i.user.id === interaction.author.id;
const lines = body.split("\n");
buttons = new Array();

console.log("ButtonPrimary ", body);
for (let index = 0; index < lines.length; index++) {

const element = lines[index].trim();
if (element == "") continue;

this["ViewButton"+index] = new ButtonBuilder()
.setLabel(element)
.setStyle(ButtonStyle.Primary)
.setCustomId(element);

buttons.push(this["ViewButton"+index]);
}

const buttonRow = new ActionRowBuilder().addComponents(buttons);

const reply = await interaction.editReply({content: "View summary", components: [buttonRow]});
const filter = (i) => i.user.id === interaction.author.id;
13 replies
DIAdiscord.js - Imagine an app
Created by Mountwolf on 1/30/2024 in #djs-questions
Dynamically adding buttons component to interaction
npm list discord.js version = 14.13.0 node version = 21.6.0
13 replies
DIAdiscord.js - Imagine an app
Created by Mountwolf on 1/28/2024 in #djs-questions
Select dropdown
Thanks alot for the help you pointed us in the right direction, we got it working after watching some videos
19 replies
DIAdiscord.js - Imagine an app
Created by Mountwolf on 1/28/2024 in #djs-questions
Select dropdown
I think we missed that let me have a look at it
19 replies
DIAdiscord.js - Imagine an app
Created by Mountwolf on 1/28/2024 in #djs-questions
Select dropdown
No description
19 replies
DIAdiscord.js - Imagine an app
Created by Mountwolf on 1/28/2024 in #djs-questions
Select dropdown
No description
19 replies
DIAdiscord.js - Imagine an app
Created by Mountwolf on 1/28/2024 in #djs-questions
Select dropdown
Let me check it a bit and then come back if its not working for me
19 replies
DIAdiscord.js - Imagine an app
Created by Mountwolf on 1/28/2024 in #djs-questions
Select dropdown
If I have a list of 30 names then how would I dynamically change the list to the last name on the list if I can only add 25 choices
19 replies
DIAdiscord.js - Imagine an app
Created by Mountwolf on 1/28/2024 in #djs-questions
Select dropdown
Thank you for the quick response, If you have a list of choices in a json file how would you import that into you interaction if it is more than 25 choices, or would you just need to set autocomplete to true
19 replies
DIAdiscord.js - Imagine an app
Created by Mountwolf on 1/28/2024 in #djs-questions
Select dropdown
npm list discord.js version = 14.13.0 node version = 21.6.0
19 replies