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 toolkit2y 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
Squid2y 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
ZanoriksOP2y 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
Squid2y ago
Are you getting a specific error?
Zanoriks
ZanoriksOP2y ago
no, only [WARN] Not found: pls-id when i click the button
Squid
Squid2y 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
ZanoriksOP2y ago
interactionCreate.js
Zanoriks
ZanoriksOP2y ago
Zanoriks
ZanoriksOP2y ago
or here
Squid
Squid2y ago
you should probably make your logs different so you actually know where it's coming from
Zanoriks
ZanoriksOP2y ago
myDudes know, but how do I edit it to show this information? logs
SpecialSauce
SpecialSauce2y ago
How do you define inter?
Zanoriks
ZanoriksOP2y ago
Zanoriks
ZanoriksOP2y ago
Thqnkqng
SpecialSauce
SpecialSauce2y ago
Log collection to the console and show result.
Zanoriks
ZanoriksOP2y ago
Zanoriks
ZanoriksOP2y ago
only it
Zanoriks
ZanoriksOP2y ago
I've done this before, but I don't know if it helps Thonk
SpecialSauce
SpecialSauce2y 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
ZanoriksOP2y ago
then what should i do to fix it?
SpecialSauce
SpecialSauce2y 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
ZanoriksOP2y 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
SpecialSauce2y ago
Where is the code that handles the "popros” button?
Zanoriks
ZanoriksOP2y ago
here ↑↓
SpecialSauce
SpecialSauce2y 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
ZanoriksOP2y ago
I changed "popros" to "zgloszenie" and now I have something like this, after clicking the button ;/
Zanoriks
ZanoriksOP2y 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
SpecialSauce2y ago
All of that looks like v13 code. You need to update that to v14.
d.js docs
d.js docs2y 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