why doesn't he find a role?

it button:
case "ok-ok-ok":
channel.send({
embeds: [
new EmbedBuilder()
.setTitle("lala")
.setDescription("kekeke")
.setFooter({ text: "lslsls" })
.setColor(0xee2a7b),
],
components: [new ActionRowBuilder().addComponents([new ButtonBuilder().setCustomId("popros-823950260300546059").setLabel("16").setStyle("Primary"), new ButtonBuilder().setCustomId("popros-823950296459509810").setLabel("18").setStyle("Primary")])],
});
case "ok-ok-ok":
channel.send({
embeds: [
new EmbedBuilder()
.setTitle("lala")
.setDescription("kekeke")
.setFooter({ text: "lslsls" })
.setColor(0xee2a7b),
],
components: [new ActionRowBuilder().addComponents([new ButtonBuilder().setCustomId("popros-823950260300546059").setLabel("16").setStyle("Primary"), new ButtonBuilder().setCustomId("popros-823950296459509810").setLabel("18").setStyle("Primary")])],
});
it in config.json
"popros": {
"rozpoczecie": [
"823950260300546059",
"823950296459509810"
],
"popros": {
"rozpoczecie": [
"823950260300546059",
"823950296459509810"
],
29 Replies
d.js toolkit
d.js toolkit11mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Post the full error stack trace, not just the top part! - Show your code! - Explain what exactly your issue is. - Not a discord.js issue? Check out #useful-servers. - Issue solved? Press the button!
Squid
Squid11mo ago
Your first code block has nothing to do with roles, and you didn't show any code where you refer to your config.json variables, so I don't know what you're expecting to happen
Zanoriks
Zanoriks11mo ago
Pastebin
const zgloszenia = require("../../models/zgloszenia");const { Messa...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Squid
Squid11mo ago
Are you getting a specific error?
Zanoriks
Zanoriks11mo ago
no, only [WARN] Not found: pls-id when i click the button
Squid
Squid11mo ago
That error doesn't come from discord.js Find where you're logging that, because it's not in the code blocks that you sent
Zanoriks
Zanoriks11mo ago
interactionCreate.js
Zanoriks
Zanoriks11mo ago
Zanoriks
Zanoriks11mo ago
or here
Squid
Squid11mo ago
you should probably make your logs different so you actually know where it's coming from
Zanoriks
Zanoriks11mo ago
myDudes know, but how do I edit it to show this information? logs
SpecialSauce
SpecialSauce11mo ago
How do you define inter?
Zanoriks
Zanoriks11mo ago
Zanoriks
Zanoriks11mo ago
Thqnkqng
SpecialSauce
SpecialSauce11mo ago
Log collection to the console and show result.
Zanoriks
Zanoriks11mo ago
Zanoriks
Zanoriks11mo ago
only it
Zanoriks
Zanoriks11mo ago
I've done this before, but I don't know if it helps Thonk
SpecialSauce
SpecialSauce11mo ago
Is popros supposed to be a command? It’s indeed not in the collection. “collection” looks like a collection of commands. Your current code can’t find “popros”.
Zanoriks
Zanoriks11mo ago
then what should i do to fix it?
SpecialSauce
SpecialSauce11mo ago
Is it supposed to be a command? What do you expect the code to do when the button is pressed and where is that code located?
Zanoriks
Zanoriks11mo ago
no, it's not a command, it's just clicking a button, after clicking the button it sends to channel x and then the administration rejects or accepts with the button
SpecialSauce
SpecialSauce11mo ago
Where is the code that handles the "popros” button?
Zanoriks
Zanoriks11mo ago
here ↑↓
SpecialSauce
SpecialSauce11mo ago
So it’s named zgloszenie? If that’s the execution code specifically for that button the names would have to match for the execute function to be called.
Zanoriks
Zanoriks11mo ago
I changed "popros" to "zgloszenie" and now I have something like this, after clicking the button ;/
Zanoriks
Zanoriks11mo ago
how? i tried with MessageActionRow and nothing, still the same consult to the documentation or guide to find out what I should actually use tries many ways but unfortunately it exists ;/ there was something written about the version, but I have a good version of 14.11.0
SpecialSauce
SpecialSauce11mo ago
All of that looks like v13 code. You need to update that to v14.
d.js docs
d.js docs11mo ago
Suggestion for @zanoriks:guide Message Components: Buttons read moreguide Additional Information: Updating from v13 to v14 read more
Want results from more Discord servers?
Add your server
More Posts