leguchi
leguchi
DIAdiscord.js - Imagine an app
Created by leguchi on 12/6/2023 in #djs-questions
Is there a way to get slash command option values even after the slash command leads to a modal?
Hi! So I was told to use a collector for this, but I'm not sure how exactly it works. I was taking a look at this. The .then(): was it for after the modal submission? Is it a replacement for async execute() for the modal?
20 replies
DIAdiscord.js - Imagine an app
Created by leguchi on 7/29/2023 in #djs-questions
Autocomplete + Other options involved that make the autocomplete dependent on those option values
Am I able to get the waiting values of the slash command options to be used for the autocomplete? I have a channel option and user option, and depending on those the string option with autocomplete should change. So, I'm not sure if it's that the options are considered to have values when the slash command is still under process. Is there any way I can make it so the autocomplete options depend on the other options if the other options are being used as well? Using Discord.js 14.11.0 node 18.13.0
5 replies
DIAdiscord.js - Imagine an app
Created by leguchi on 5/28/2023 in #djs-questions
setDefaultMemberPermissions() for one of two roles that have same permissions
How can I set default member permission to a slash command? I know there's .setDefaultMemberPermissions(), but I have two roles that have the same permissions, and I'd like only one of them to get access to this command. discord.js: 14.11.0
5 replies
DIAdiscord.js - Imagine an app
Created by leguchi on 4/10/2023 in #djs-questions
Context menu trigger either creates or edits a message
I have a message context menu command that's working for the first if statement where it checks the database and creates a message in a different channel if the searched table is empty. However, I also have included other statements for if the number of results in the database is less than 3 (with it being the same callerId or not) it just edits the message's embed sent in the different channel, and if the number of results is greater than or equal to 3 with different callerId's, it just edits the message's embed and components sent in the different channel. I have a final part where it replies back to the user of the command which works fine, and there are no errors showing in logs. It is just unable to edit the message. Using 14.9.0. https://sourceb.in/oBfNmBBLKG
3 replies
DIAdiscord.js - Imagine an app
Created by leguchi on 4/3/2023 in #djs-questions
Deleting commands followed but still appear on Discord
Up until yesterday was using 14.8.0, now 14.9.0, I have a problem where the bot has slash commands appear that are no longer within my code because I used the deleting commands guide https://discordjs.guide/slash-commands/deleting-commands.html#deleting-specific-commands but brought back a different branch that may have had it, deleted it via the IDE's files once more. Now I have the commands still look as if they are available but they do not work because the commands with those id's are no longer available with the project, and I am unsure how to get rid of the commands from this point. I do not have any commands as of now except context menu's which works.
34 replies
DIAdiscord.js - Imagine an app
Created by leguchi on 3/14/2023 in #djs-questions
Defer reply to have the 3 seconds be longer for an edit reply.
Using 14.7.1, I am wondering if there is a solution to another >3 seconds time length for message to be sent, but when the interaction is rather going towards editing a message. Another way to describe it would be: The process towards editing the message takes supposedly longer than 3sec, but it is not creating the message from scratch. I believe my code is irrelevant to this question so I'll leave it out, but it would be great if I could hear back with solutions on another defer-message kind of process. I am unable to do a follow up because I already have that existing as well.
3 replies
DIAdiscord.js - Imagine an app
Created by leguchi on 2/12/2023 in #djs-questions
Adding options of select menu in if statements using select menu builder before it is sent
I have a question about updating components. I have it so in the function it previously does up to this:
let menu = new ActionRowBuilder()
.addComponents(
new StringSelectMenuBuilder()
.setCustomId('listFieldsEmbedBuilder')
.setPlaceholder('Select one:')
.setMaxValues(1)
.setMinValues(1),
);
let menu = new ActionRowBuilder()
.addComponents(
new StringSelectMenuBuilder()
.setCustomId('listFieldsEmbedBuilder')
.setPlaceholder('Select one:')
.setMaxValues(1)
.setMinValues(1),
);
and then later I try this within an if statement:
menu.setComponents(
StringSelectMenuBuilder.from(menu.components[0].data)
.addOptions({ label: 'Create', value: 'newField', description: 'Create a new field in the message.' }));
menu.setComponents(
StringSelectMenuBuilder.from(menu.components[0].data)
.addOptions({ label: 'Create', value: 'newField', description: 'Create a new field in the message.' }));
and I have it do it once more after another if statement. In some cases, it'll pass through both statements. How can I solve this so it stays within the same select menu?
14 replies