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