From 8d3d1445d47e36971149b7975d27d0ea3893fd19 Mon Sep 17 00:00:00 2001 From: idinium96 <47635037+idinium96@users.noreply.github.com> Date: Fri, 19 Jul 2024 06:15:36 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/classes/DiscordBot.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/classes/DiscordBot.ts b/src/classes/DiscordBot.ts index 68c9fd92e..ddd96ac41 100644 --- a/src/classes/DiscordBot.ts +++ b/src/classes/DiscordBot.ts @@ -33,8 +33,10 @@ export default class DiscordBot { }); // 'ready' binding should be executed BEFORE the login() is complete + /* eslint-disable */ this.client.on('ready', this.onClientReady.bind(this)); this.client.on('messageCreate', async message => this.onMessage(message)); + /* eslint-enable */ this.prefix = this.bot.options.miscSettings?.prefixes?.discord ?? this.prefix; } @@ -49,6 +51,7 @@ export default class DiscordBot { } ]); + /* eslint-disable */ this.client.on('interactionCreate', async interaction => { if (!interaction.isChatInputCommand()) return; @@ -56,6 +59,7 @@ export default class DiscordBot { await interaction.reply({ content: uptime() }); } }); + /* eslint-enable */ } catch (err) { const error = err as DiscordAPIError; @@ -174,8 +178,8 @@ export default class DiscordBot { .send(message) // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - .then(() => log.info(`Message sent to ${origMessage.author.tag} (${origMessage.author.id}): ${message}`)) - .catch(err => log.error('Failed to send message to Discord:', err)); + .then(() => log.info(`Message sent to ${origMessage.author.tag} (${origMessage.author.id}): ${message}`)); + // .catch((err: any) => log.error('Failed to send message to Discord:', err)); } private async onClientReady() { @@ -206,6 +210,7 @@ export default class DiscordBot { setPresence(type: 'online' | 'halt'): void { const opt = this.bot.options.discordChat[type]; + /* eslint-disable */ this.client?.user?.setPresence({ activities: [ { @@ -218,6 +223,7 @@ export default class DiscordBot { ], status: opt.status }); + /* eslint-enable */ } halt(): void {