feat: add extra event listeners
This commit is contained in:
+20
-1
@@ -1,8 +1,13 @@
|
|||||||
import {
|
import {
|
||||||
|
BaseInteraction,
|
||||||
|
CacheType,
|
||||||
Client,
|
Client,
|
||||||
GatewayIntentBits,
|
GatewayIntentBits,
|
||||||
|
Interaction,
|
||||||
|
Message,
|
||||||
OAuth2Scopes,
|
OAuth2Scopes,
|
||||||
PermissionFlagsBits
|
PermissionFlagsBits,
|
||||||
|
VoiceState
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import { Logger } from './utils/log';
|
import { Logger } from './utils/log';
|
||||||
import { config } from './utils/config';
|
import { config } from './utils/config';
|
||||||
@@ -45,6 +50,9 @@ export class Bot {
|
|||||||
this.client.on('clientReady', () => this.onReady());
|
this.client.on('clientReady', () => this.onReady());
|
||||||
this.client.on('error', (err) => this.onError(err, false));
|
this.client.on('error', (err) => this.onError(err, false));
|
||||||
this.client.on('shardError', (err) => this.onError(err, true));
|
this.client.on('shardError', (err) => this.onError(err, true));
|
||||||
|
this.client.on('messageCreate', (message: Message<boolean>) => this.onMessage(message));
|
||||||
|
this.client.on('interactionCreate', (interaction: Interaction<CacheType>) => this.onInteraction(interaction));
|
||||||
|
this.client.on('voiceStateUpdate', (oldState: VoiceState, newState: VoiceState) => this.onVoiceStateUpdate(oldState, newState));
|
||||||
|
|
||||||
this.log.info('Logging in...');
|
this.log.info('Logging in...');
|
||||||
await this.client.login(this.token);
|
await this.client.login(this.token);
|
||||||
@@ -92,6 +100,17 @@ export class Bot {
|
|||||||
error.stack
|
error.stack
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
private async onInteraction(interaction: BaseInteraction): Promise<void> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private async onMessage(message: Message<boolean>): Promise<void> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private async onVoiceStateUpdate(oldState: VoiceState, newState: VoiceState): Promise<void> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
singleton logic
|
singleton logic
|
||||||
|
|||||||
Reference in New Issue
Block a user