Browse Source

Declare filter before used in collector

master
Abheek Dhawan 4 years ago
parent
commit
e0db36b46b
  1. 8
      bot.js

8
bot.js

@ -43,6 +43,10 @@ client.on("ready", () => {
}); });
client.on("message", async message => { client.on("message", async message => {
const filter = reaction => {
return reaction.emoji.name === '😎';
};
const collector = message.createReactionCollector(filter); const collector = message.createReactionCollector(filter);
collector.on('collect', (reaction, user) => { collector.on('collect', (reaction, user) => {
@ -115,10 +119,6 @@ client.on("message", async message => {
} else if (message.content.toLowerCase().startsWith(`${prefix}aboutbot`)) { } else if (message.content.toLowerCase().startsWith(`${prefix}aboutbot`)) {
aboutBot(message); aboutBot(message);
} }
const filter = reaction => {
return reaction.emoji.name === '😎';
};
}); });
async function aboutBot(message) { async function aboutBot(message) {

Loading…
Cancel
Save