🖤 • Nelson • 🖤
🖤 • Nelson • 🖤
DIAdiscord.js - Imagine an app
Created by 🖤 • Nelson • 🖤 on 8/14/2023 in #djs-questions
Creation of a selection menu
Good morning. To accompany my embed, I want to add a selection menu that retrieves the values ​​stored in my database and reuses them to make the label of my options. Here is the code and the error
8 replies
DIAdiscord.js - Imagine an app
Created by 🖤 • Nelson • 🖤 on 8/13/2023 in #djs-questions
Updating an embed following interaction with a button
Hello, I have an embed with 2 buttons, a first which validates and a second which cancels. I would like for example that when I cancel, the buttons disappear to just leave the message of cancellation. Excluding the buttons remains present. I created a new embed, then I called this line of code to update my message: interaction.update({embeds: [Error]} but as said before, the embed changes, but I can't get the pimples to go away/
6 replies
DIAdiscord.js - Imagine an app
Created by 🖤 • Nelson • 🖤 on 8/13/2023 in #djs-questions
Get the list of roles for a server and browse it.
Still a little question about the roles, I would like to retrieve the complete list of all the roles to browse it and retrieve the roles 1 by 1 to do manipulations on them. How could I go about it, I don't know if guild.roles.cache.find(...) will be useful for me to do this?
9 replies
DIAdiscord.js - Imagine an app
Created by 🖤 • Nelson • 🖤 on 6/30/2023 in #djs-questions
Change user nickname
Good morning. I want to change the nickname of the user whose user id is entered in the command option, except I did some research and I found a line of code but it does not work, an idea ? Error :
C:\Users\Elève\Desktop\Project\HeartOfBot\Commands\testvalidation.js:147
message.guild.members.get(val[0].User).setNickname(`${val[0].King}`)
^

TypeError: message.guild.members.get is not a function
at Query.<anonymous> (C:\Users\Elève\Desktop\Project\HeartOfBot\Commands\testvalidation.js:147:43)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

Node.js v17.0.0
C:\Users\Elève\Desktop\Project\HeartOfBot\Commands\testvalidation.js:147
message.guild.members.get(val[0].User).setNickname(`${val[0].King}`)
^

TypeError: message.guild.members.get is not a function
at Query.<anonymous> (C:\Users\Elève\Desktop\Project\HeartOfBot\Commands\testvalidation.js:147:43)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

Node.js v17.0.0
21 replies
DIAdiscord.js - Imagine an app
Created by 🖤 • Nelson • 🖤 on 6/29/2023 in #djs-questions
Click a button and edit the embed
Good morning. I come to you because I would like that when I click on my button, my embed is modified. What I do is that I send my embed with the buttons via a /testvalidation command and I constantly check in interactionCreate if it detects a click on the button. If this button is clicked then I ask him to take back the message stored in interaction and therefore to create a new embed by defining each of the properties that I need and then to create a new button which corresponds to the same button as in my first embed and then modify the message to replace it with the new embed and the new buttons by doing interaction.edit({embeds: [Liste], components: [row]}) out it tells me that edit is not a function... Error :
C:\Users\Elève\Desktop\Project\HeartOfBot\Events\interactionCreate.js:222
await interaction.edit({embeds: [Liste], components: [row]})
^

TypeError: interaction.edit is not a function
at Query.<anonymous> (C:\Users\Elève\Desktop\Project\HeartOfBot\Events\interactionCreate.js:222:47)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

Node.js v17.0.0
C:\Users\Elève\Desktop\Project\HeartOfBot\Events\interactionCreate.js:222
await interaction.edit({embeds: [Liste], components: [row]})
^

TypeError: interaction.edit is not a function
at Query.<anonymous> (C:\Users\Elève\Desktop\Project\HeartOfBot\Events\interactionCreate.js:222:47)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

Node.js v17.0.0
9 replies
DIAdiscord.js - Imagine an app
Created by 🖤 • Nelson • 🖤 on 6/25/2023 in #djs-questions
Split a string into a list and iterate through it
Good morning. So I come to ask you a somewhat dumb question, I know that to normally retrieve a list of the elements of a character string you have to use the .split() method, except when I want to do the .length() method on my list obtained to retrieve the size of the list to make a loop that traverses it, it does not work it tells me that .length is not a valid function or method, so that probably I do not apply it not to a list. But I don't understand since normally by performing .split() I am supposed to retrieve a list, do you have an idea of ​​the problem?
4 replies
DIAdiscord.js - Imagine an app
Created by 🖤 • Nelson • 🖤 on 6/24/2023 in #djs-questions
Autocomplete options fields of the `/` command.
Good morning. I wanted to come and ask you a question about the autocompletion of the options fields of a / command. When applying autocompletion to a single option field: let's say I have the /help command with option => command, when I simply need to apply autocompletion to a single option field I manage to find the solution. However, I did some research, and when I want to apply autocompletion to several fields: Let's take the example of the /funny command, which takes the option => title, color and category, here I want to apply autocompletion to the color option and the category option but with different values ​​outside, I can't find how to achieve this. I thought of making a condition that checks if the focus option is the color option or if the focus option is the category option. But it doesn't work, I can't even get the option separately. Do you have an idea to guide me?
4 replies