Madder
Madder
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
thank you all!
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
now winner is undefined but that's not djs, just js, i can get that fixed
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
keys and emoji came out to 💩
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
okay this is working
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
one sec
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
i've just never seen that format before, apologies
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
No description
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
sure one sec
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
the message id there is definitely correct
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
two reactions, one from myself and one from my friend
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
No description
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
empty map
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
let reactedUsers = await reactions.get(emojiOption).users.fetch();
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
ahh okay
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
let reactedUsers = await reactions.get(emojiOption).fetch();
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
still a map with size 0
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
How would I fetch the reaction?
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
No description
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
Okay, that worked. Now reactedUsers is a Map with size 0, even though the message being pulled has 2 💩 reactions on it.
async execute(interaction) {
await interaction.deferReply({ ephemeral: true });
let messageOption = await interaction.options.getString("targetmessage");
let emojiOption = await interaction.options.getString("entryemoji");

let message = await interaction.channel.messages.fetch(messageOption);

let reactions = await message.reactions.cache.filter((reaction) => {
return reaction.emoji.name == emojiOption ? true : false;
});

let reactedUsers = await reactions.get(emojiOption).users.cache;

let winner = reactedUsers[Math.random(reactedUsers.count() - 1)];

await interaction.editReply(
`${winner.displayName} is the winner of the giveaway!`
);
}
async execute(interaction) {
await interaction.deferReply({ ephemeral: true });
let messageOption = await interaction.options.getString("targetmessage");
let emojiOption = await interaction.options.getString("entryemoji");

let message = await interaction.channel.messages.fetch(messageOption);

let reactions = await message.reactions.cache.filter((reaction) => {
return reaction.emoji.name == emojiOption ? true : false;
});

let reactedUsers = await reactions.get(emojiOption).users.cache;

let winner = reactedUsers[Math.random(reactedUsers.count() - 1)];

await interaction.editReply(
`${winner.displayName} is the winner of the giveaway!`
);
}
40 replies
DIAdiscord.js - Imagine an app
Created by Madder on 6/1/2024 in #djs-questions
Trying to pull users who reacted to a specified message with a specified emoji, need some guidance
Okay, my bad
40 replies