diff options
| author | Max Isom <[email protected]> | 2020-03-16 20:14:15 -0500 |
|---|---|---|
| committer | Max Isom <[email protected]> | 2020-03-16 20:14:15 -0500 |
| commit | ac21b5657ba47ef9081c80424d5f8ae39b149f35 (patch) | |
| tree | 1ba121343bb3ae33b6345afc217e2c29b92c23a9 /src/bot.ts | |
| parent | 32cb3ca4ae6a419f64e413ba5c8c543593a927b1 (diff) | |
| download | muse-ac21b5657ba47ef9081c80424d5f8ae39b149f35.tar.xz muse-ac21b5657ba47ef9081c80424d5f8ae39b149f35.zip | |
Add auto disconnect
Diffstat (limited to 'src/bot.ts')
| -rw-r--r-- | src/bot.ts | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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); } |
