Move location of messageID variable so it doesn't get reset on every reaction

This commit is contained in:
loicbersier 2019-12-27 18:48:15 +01:00
parent aef0caae25
commit 23170a379b

View file

@ -1,5 +1,6 @@
const { Listener } = require('discord-akairo'); const { Listener } = require('discord-akairo');
const fs = require('fs'); const fs = require('fs');
let messageID = []; // Where reaction.message.id that entered a board will be stocked so it doesn't enter again
class MessageReactionAddListener extends Listener { class MessageReactionAddListener extends Listener {
@ -12,9 +13,8 @@ class MessageReactionAddListener extends Listener {
async exec(reaction, user) { async exec(reaction, user) {
if (reaction.message.author == user) return; if (reaction.message.author == user) return;
let messageID = []; // Where reaction.message.id that entered a board will be stocked so it doesn't enter again
let starboardChannel, shameboardChannel; let starboardChannel, shameboardChannel;
if (messageID.includes(reaction.message.id)) return; if (messageID.includes(reaction.message.id)) return;
// Starboard // Starboard