diff --git a/index.js b/index.js index 65204c17..ace6db82 100644 --- a/index.js +++ b/index.js @@ -23,6 +23,8 @@ const clevs = new Cleverbot({ nick: 'XiaoBot' }); +let mention; + client.setProvider(new SequelizeProvider(Database.db)); client.registry @@ -45,7 +47,6 @@ client.registry .registerDefaultCommands({ help: false }) .registerCommandsIn(path.join(__dirname, 'commands')); -const mention = new RegExp(`()`, 'g'); client.on('message', async (msg) => { if (msg.isMentioned(client.user)) { const message = msg.content.replace(mention, ''); @@ -141,6 +142,7 @@ client.on('disconnect', (event) => { client.on('ready', () => { console.log(`[Ready] Shard ${client.shard.id} Logged in!`); client.user.setGame(`x;help | Shard ${client.shard.id}`); + mention = new RegExp(`()`, 'g'); }); client.login(TOKEN);