fix discord integration not receiving messages

This commit is contained in:
wea_ondara
2024-05-28 18:32:30 +02:00
parent 5c43ce6604
commit 3a78660883

View File

@@ -7,11 +7,17 @@ export default class DcClient {
constructor(aiInstance: AiInstance) { constructor(aiInstance: AiInstance) {
this.aiInstance = aiInstance; this.aiInstance = aiInstance;
this.client = new Client({intents: [GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent]}); this.client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.MessageContent],
});
this.client.once(Events.ClientReady, readyClient => { this.client.once(Events.ClientReady, readyClient => {
console.log(`Ready! Logged in as ${readyClient.user.tag}`); console.log(`Ready! Logged in as ${readyClient.user.tag}`);
}); });
this.client.on(Events.MessageCreate, this.handleChat.bind(this)); this.client.on(Events.MessageCreate, (message) => this.handleChat(message));
} }
async connect(): Promise<void> { async connect(): Promise<void> {