forked from Supositware/Haha-Yes
fix for star/shameboard
This commit is contained in:
parent
3becb69642
commit
f0d66466f5
1 changed files with 15 additions and 15 deletions
|
@ -18,36 +18,36 @@ class MessageReactionAddListener extends Listener {
|
||||||
|
|
||||||
let messageContent = reaction.message.content;
|
let messageContent = reaction.message.content;
|
||||||
let messageAttachments = reaction.message.attachments.map(u=> u.url);
|
let messageAttachments = reaction.message.attachments.map(u=> u.url);
|
||||||
|
|
||||||
|
// Starboard
|
||||||
if (fs.existsSync(`./board/star${reaction.message.guild.id}.json`)) {
|
if (fs.existsSync(`./board/star${reaction.message.guild.id}.json`)) {
|
||||||
starboardChannel = require(`../../board/star${reaction.message.guild.id}.json`);
|
starboardChannel = require(`../../board/star${reaction.message.guild.id}.json`);
|
||||||
staremote = starboardChannel['emote'];
|
staremote = starboardChannel['emote'];
|
||||||
starcount = starboardChannel['count'];
|
starcount = starboardChannel['count'];
|
||||||
|
|
||||||
// Starboard
|
|
||||||
if (reaction.emoji.name == staremote && reaction.count == starcount) {
|
if (reaction.emoji.name == staremote && reaction.count == starcount) {
|
||||||
if (messageID.includes(reaction.message.id))
|
if (messageID.includes(reaction.message.id)) {
|
||||||
return console.log('Message already in starboard!');
|
console.log('Message already in starboard!');
|
||||||
|
} else {
|
||||||
messageID.push(reaction.message.id);
|
messageID.push(reaction.message.id);
|
||||||
|
sendEmbed('starboard', staremote, this.client);
|
||||||
sendEmbed('starboard', staremote, this.client);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Shameboard
|
||||||
if (fs.existsSync(`./board/shame${reaction.message.guild.id}.json`)) {
|
if (fs.existsSync(`./board/shame${reaction.message.guild.id}.json`)) {
|
||||||
shameboardChannel = require(`../../board/shame${reaction.message.guild.id}.json`);
|
shameboardChannel = require(`../../board/shame${reaction.message.guild.id}.json`);
|
||||||
shameemote = shameboardChannel['emote'];
|
shameemote = shameboardChannel['emote'];
|
||||||
shamecount = shameboardChannel['count'];
|
shamecount = shameboardChannel['count'];
|
||||||
|
|
||||||
//Shameboard
|
|
||||||
if (reaction.emoji.name == shameemote && reaction.count == shamecount) {
|
if (reaction.emoji.name == shameemote && reaction.count == shamecount) {
|
||||||
if (messageID.includes(reaction.message.id))
|
if (messageID.includes(reaction.message.id)) {
|
||||||
return console.log('Message already in starboard!');
|
console.log('Message already in shameboard!');
|
||||||
|
} else {
|
||||||
messageID.push(reaction.message.id);
|
messageID.push(reaction.message.id);
|
||||||
|
sendEmbed('shameboard', shameemote, this.client);
|
||||||
sendEmbed('shameboard', shameemote, this.client);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue