@@ -3,6 +3,7 @@ import { Client, REST, Routes } from 'discord.js';
3
3
import { voiceOnDemandCommand } from './commands' ;
4
4
import { config } from './config' ;
5
5
import { deleteExistingCommands } from './delete-existing-commands' ;
6
+ import { handleGuildMessageCreation } from './handlers/handle-guild-message-creation' ;
6
7
import { handleInteractionCreation } from './handlers/handle-interaction-creation' ;
7
8
import { handleVoiceChannelDeletion } from './handlers/handle-voice-channel-deletion' ;
8
9
import { handleVoiceStateUpdate } from './handlers/handle-voice-state-update' ;
@@ -24,7 +25,7 @@ const bootstrap = async (client: Client) => {
24
25
} ;
25
26
26
27
const client = new Client ( {
27
- intents : [ 'Guilds' , 'GuildVoiceStates' , 'GuildMembers' ] ,
28
+ intents : [ 'Guilds' , 'GuildVoiceStates' , 'GuildMembers' , 'GuildMessages' , 'MessageContent' ] ,
28
29
} ) ;
29
30
30
31
await bootstrap ( client ) ;
@@ -41,6 +42,10 @@ client.on('interactionCreate', async (interaction) => {
41
42
await handleInteractionCreation ( interaction ) ;
42
43
} ) ;
43
44
45
+ client . on ( 'messageCreate' , async ( message ) => {
46
+ await handleGuildMessageCreation ( message ) ;
47
+ } ) ;
48
+
44
49
const rest = new REST ( { version : '10' } ) . setToken ( discord . token ) ;
45
50
46
51
await deleteExistingCommands ( rest , discord ) ;
0 commit comments