aboutsummaryrefslogtreecommitdiff
path: root/src/bot.ts
diff options
context:
space:
mode:
authorMax Isom <[email protected]>2020-03-16 20:14:15 -0500
committerMax Isom <[email protected]>2020-03-16 20:14:15 -0500
commitac21b5657ba47ef9081c80424d5f8ae39b149f35 (patch)
tree1ba121343bb3ae33b6345afc217e2c29b92c23a9 /src/bot.ts
parent32cb3ca4ae6a419f64e413ba5c8c543593a927b1 (diff)
downloadmuse-ac21b5657ba47ef9081c80424d5f8ae39b149f35.tar.xz
muse-ac21b5657ba47ef9081c80424d5f8ae39b149f35.zip
Add auto disconnect
Diffstat (limited to 'src/bot.ts')
-rw-r--r--src/bot.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bot.ts b/src/bot.ts
index d6d6903..b54e665 100644
--- a/src/bot.ts
+++ b/src/bot.ts
@@ -2,9 +2,10 @@ import {Client, Message, Collection} from 'discord.js';
import {inject, injectable} from 'inversify';
import {TYPES} from './types';
import {Settings, Shortcut} from './models';
-import handleGuildCreate from './events/guild-create';
import container from './inversify.config';
import Command from './commands';
+import handleGuildCreate from './events/guild-create';
+import handleVoiceStateUpdate from './events/voice-state-update';
@injectable()
export default class {
@@ -87,12 +88,11 @@ export default class {
console.log(`Ready! Invite the bot with https://discordapp.com/oauth2/authorize?client_id=${this.clientId}&scope=bot`);
});
- this.client.on('error', error => {
- console.error(error);
- });
+ this.client.on('error', console.error);
// Register event handlers
this.client.on('guildCreate', handleGuildCreate);
+ this.client.on('voiceStateUpdate', handleVoiceStateUpdate);
return this.client.login(this.token);
}