#Get user who clicked button
18 messages · Page 1 of 1 (latest)
• 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.
await confirmation.update({ embeds: [potwierdzenie], components: [] });
const myDB = getDb();
const db = myDB.collection(`ThxList`);
const doc = {
user: user.username + "#" + user.discriminator,
userId: user.id,
from: interaction.user.username,
fromId: interaction.user.id,
acceptedBy: ???,
};
const result = await db.insertOne(doc);
console.log(
`A document was inserted with the _id: ${result.insertedId}`
);
buttoninteraction.member.nickname or .displayName
What is interaction? The button interaction?
And what is confirmation
They both seem to be interactions, looks like confirmation is the buttoninteraction from what you said
const confirmation = await response.awaitMessageComponent({ time: null });
I was right, why is the time null btw
async execute(interaction) {......
is that infinity
Just a tip for adding code in discord. https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline-#h_01GY0DAKGXDEHE263BCAYEGFJA
confirmation.member.nickname or confirmation.member.displayName to get the username if the nickname is null. From ur code, you're not tryna get the nickname, that's the username
I fix that
thanks
I mean, technically but you can just not pass it, which I don't recommend cuz then if the person doesn't click you'd have the collector going on forever which can affect memory and stuff
If more than one collector is created and stuff of course
ok