Dismissed
Dismissed
DIAdiscord.js - Imagine an app
Created by Dismissed on 6/26/2024 in #djs-questions
Bot not reading the correct number of reactions on a message (reads only 1)
That worked, thanks. I'm surprised it didn't throw any "error" or so tho smh
5 replies
DIAdiscord.js - Imagine an app
Created by Dismissed on 6/26/2024 in #djs-questions
Bot not reading the correct number of reactions on a message (reads only 1)
As can be seen in the screenshot, there should be 2 "Arrowup" reactions not 1
5 replies
DIAdiscord.js - Imagine an app
Created by Dismissed on 6/26/2024 in #djs-questions
Bot not reading the correct number of reactions on a message (reads only 1)
console log output:
===================================
emojiName = Arrowup
emojiCount = 1
===================================
emojiName = Arrowdown
emojiCount = 1
UpvoteContainer.msgUpvoteCount.push(x): 0
===================================
emojiName = Arrowup
emojiCount = 1
===================================
emojiName = Arrowdown
emojiCount = 1
UpvoteContainer.msgUpvoteCount.push(x): 0
5 replies
DIAdiscord.js - Imagine an app
Created by Dismissed on 6/25/2024 in #djs-questions
Failing to get message.reactions.cache "undefined"
THANK YOU
4 replies
DIAdiscord.js - Imagine an app
Created by Dismissed on 6/25/2024 in #djs-questions
Detect reactions
I was hoping I could use client.on("messageReactionAdd" ) but apparently that only works with "cached" messages so if anyone also knows how to do that that'd be nice as I feel more confident with using client.on()
4 replies
DIAdiscord.js - Imagine an app
Created by Dismissed on 6/25/2024 in #djs-questions
Detect reactions
for reference I'm doing the same thing here, but this is to check for new messages instead of checking for new reactions:
client.on("messageCreate", async (msg) =>
{
//Check if need to start listening to messages first as to not waste resources
if (UpvoteContainer.ON == true)
{
let upvote_channel_ID = 0;
//check if message is in a channel used.
for (const x of UpvoteContainer.valid_channel_IDs)
{
if (x == msg.channelId)
{
upvote_channel_ID = x;
break;
}
}
//Only proceed is a valid channel is being used
if (upvote_channel_ID != 0)
{
if (msg.author.tag != client.user.tag)
{
UpvoteContainer.msgID.push(msg.id);
UpvoteContainer.msgAuthor.push(msg.author.displayName);
}
}
}
client.on("messageCreate", async (msg) =>
{
//Check if need to start listening to messages first as to not waste resources
if (UpvoteContainer.ON == true)
{
let upvote_channel_ID = 0;
//check if message is in a channel used.
for (const x of UpvoteContainer.valid_channel_IDs)
{
if (x == msg.channelId)
{
upvote_channel_ID = x;
break;
}
}
//Only proceed is a valid channel is being used
if (upvote_channel_ID != 0)
{
if (msg.author.tag != client.user.tag)
{
UpvoteContainer.msgID.push(msg.id);
UpvoteContainer.msgAuthor.push(msg.author.displayName);
}
}
}
4 replies