1
0
Fork 0

fixed the command not working

akairo
loicbersier 5 years ago
parent 4ceb666727
commit ee8957913f

@ -15,38 +15,40 @@ class MessageReactionAddListener extends Listener {
async exec(reaction, user) {
if (reaction.message.author == user) return;
let starboardChannel, shameboardChannel, staremote, starcount, shameemote, shamecount;
let messageContent = reaction.message.content;
let messageAttachments = reaction.message.attachments.map(u=> u.url);
if (fs.existsSync(`./board/star${reaction.message.guild.id}.json`)) {
starboardChannel = require(`../../board/star${reaction.message.guild.id}.json`);
staremote = starboardChannel['emote'];
starcount = starboardChannel['count'];
// Starboard
if (reaction.emoji.name == staremote && reaction.count == starcount) {
if (messageID.includes(reaction.message.id))
return console.log('Message already in starboard!');
messageID.push(reaction.message.id);
sendEmbed('starboard', staremote, this.client);
}
}
if (fs.existsSync(`./board/shame${reaction.message.guild.id}.json`)) {
shameboardChannel = require(`../../board/shame${reaction.message.guild.id}.json`);
shameemote = shameboardChannel['emote'];
shamecount = shameboardChannel['count'];
}
let messageContent = reaction.message.content;
let messageAttachments = reaction.message.attachments.map(u=> u.url);
//Shameboard
if (reaction.emoji.name == shameemote && reaction.count == shamecount) {
if (messageID.includes(reaction.message.id))
return console.log('Message already in starboard!');
// Starboard
if (reaction.emoji.name == staremote && reaction.count == starcount) {
if (messageID.includes(reaction.message.id))
return console.log('Message already in starboard!');
messageID.push(reaction.message.id);
messageID.push(reaction.message.id);
sendEmbed('starboard', staremote, this.client);
}
//Shameboard
if (reaction.emoji.name == shameemote && reaction.count == shamecount) {
if (messageID.includes(reaction.message.id))
return console.log('Message already in starboard!');
messageID.push(reaction.message.id);
sendEmbed('shameboard', shameemote, this.client);
sendEmbed('shameboard', shameemote, this.client);
}
}
function sendEmbed(name, emote, client) {

Loading…
Cancel
Save