aboutsummaryrefslogtreecommitdiff
path: root/src/bot.ts
diff options
context:
space:
mode:
authorMax Isom <[email protected]>2021-11-17 16:07:29 -0500
committerGitHub <[email protected]>2021-11-17 16:07:29 -0500
commit41b050a2f1fe4e2cb94629e2add1b490a69a2004 (patch)
tree78a10ca06380acfa6a114b734b206325b06610ad /src/bot.ts
parenta4e67d63839154916783e7b4a5f6c65006e759f3 (diff)
parent96bf53b28a9cfa30e1d171ae0539f52fd926e1c2 (diff)
downloadmuse-41b050a2f1fe4e2cb94629e2add1b490a69a2004.tar.xz
muse-41b050a2f1fe4e2cb94629e2add1b490a69a2004.zip
Merge pull request #397 from Hellysonrp/discord-js-v13
Diffstat (limited to 'src/bot.ts')
-rw-r--r--src/bot.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bot.ts b/src/bot.ts
index 5d2e97e..b49c1f6 100644
--- a/src/bot.ts
+++ b/src/bot.ts
@@ -11,6 +11,7 @@ import handleVoiceStateUpdate from './events/voice-state-update.js';
import errorMsg from './utils/error-msg.js';
import {isUserInVoice} from './utils/channels.js';
import Config from './services/config.js';
+import {generateDependencyReport} from '@discordjs/voice';
@injectable()
export default class {
@@ -34,7 +35,7 @@ export default class {
commandNames.forEach(commandName => this.commands.set(commandName, command));
});
- this.client.on('message', async (msg: Message) => {
+ this.client.on('messageCreate', async (msg: Message) => {
// Get guild settings
if (!msg.guild) {
return;
@@ -44,7 +45,8 @@ export default class {
if (!settings) {
// Got into a bad state, send owner welcome message
- return this.client.emit('guildCreate', msg.guild);
+ this.client.emit('guildCreate', msg.guild);
+ return;
}
const {prefix, channel} = settings;
@@ -95,6 +97,7 @@ export default class {
});
this.client.on('ready', async () => {
+ debug(generateDependencyReport());
console.log(`Ready! Invite the bot with https://discordapp.com/oauth2/authorize?client_id=${this.client.user?.id ?? ''}&scope=bot&permissions=36752448`);
});