What do I have to do to store how many upvotes and downvotes people have?

I was looking at this suggestion bot and it looks pretty cool. right now I am deleting suggestions but I think this is a better idea. I use MySQL to store all of the info (except the up/down votes) currently. Can those up/down votes be stored in SQL? Or is there a quick piece of code I can get that info from?
5 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
CanineData
CanineData2y ago
Not djs related #useful-servers
Erin
Erin2y ago
How do I get this info? I know how to get id of suggestion and user ID just not whether it is up or down vote. I use 👍 and 👎 reactions. Alright, in that event can I do something like if(channel == suggestions channel ID) so it only does things in that channel? I'm testing this now as I haven't had a chance until now. This is not logging anything...
module.exports = {
name: 'messageReactionAdd',
async execute(message, client) {
console.log(message)
}
}
module.exports = {
name: 'messageReactionAdd',
async execute(message, client) {
console.log(message)
}
}
I added intents:
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMessageReactions], partials: [Partials.Channel] });
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMessageReactions], partials: [Partials.Channel] });
I do also have manage messages permission but it doesn't even error. Nothing logs.
d.js docs
d.js docs2y ago
event (event) Client#messageReactionAdd Emitted whenever a reaction is added to a cached message.
Erin
Erin2y ago
module.exports = {
name: 'messageReactionAdd',
async execute(messageReaction, user) {
console.log(messageReaction)
}
}
module.exports = {
name: 'messageReactionAdd',
async execute(messageReaction, user) {
console.log(messageReaction)
}
}
|-----------------------------------|
Loading Event Files...
|-----------------------------------|
interactionCreate loaded successfully!
messageCreate loaded successfully!
messageReactionAdd loaded successfully!
messageReactionRemove loaded successfully!
ready loaded successfully!
|-----------------------------------|
|-----------------------------------|
Loading Event Files...
|-----------------------------------|
interactionCreate loaded successfully!
messageCreate loaded successfully!
messageReactionAdd loaded successfully!
messageReactionRemove loaded successfully!
ready loaded successfully!
|-----------------------------------|
According to my logs it is. Still doesn't log. That makes sense. Partial worked. Thank you