fix discord integration not receiving messages
This commit is contained in:
@@ -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> {
|
||||||
|
|||||||
Reference in New Issue
Block a user