style: run format:apply

This commit is contained in:
2026-01-10 09:27:41 -03:00
parent 710de16af1
commit f0e8f5e939
+22 -8
View File
@@ -12,9 +12,9 @@ import { Logger } from './utils/log';
import { config } from './utils/config';
type BotEventListeners = {
'messageCreate': (message: Message) => void;
'interactionCreate': (interaction: Interaction) => void;
'voiceStateUpdate': (oldState: VoiceState, newState: VoiceState) => void;
messageCreate: (message: Message) => void;
interactionCreate: (interaction: Interaction) => void;
voiceStateUpdate: (oldState: VoiceState, newState: VoiceState) => void;
};
type BotEventListener<K extends keyof BotEventListeners> = BotEventListeners[K];
@@ -80,7 +80,10 @@ export class Bot {
try {
(listener as (...args: unknown[]) => void)(...args);
} catch (error) {
this.log.error(`Error in event listener for ${String(event)}:`, error);
this.log.error(
`Error in event listener for ${String(event)}:`,
error
);
}
}
}
@@ -116,9 +119,17 @@ export class Bot {
this.client.on('clientReady', () => this.onReady());
this.client.on('error', (err) => this.onError(err, false));
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.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...');
await this.client.login(this.token);
@@ -178,7 +189,10 @@ export class Bot {
this.emit('messageCreate', message);
}
private async onVoiceStateUpdate(oldState: VoiceState, newState: VoiceState): Promise<void> {
private async onVoiceStateUpdate(
oldState: VoiceState,
newState: VoiceState
): Promise<void> {
this.emit('voiceStateUpdate', oldState, newState);
}