From 21c69329ee0f7a9c32b7bb3af82839e4ad859400 Mon Sep 17 00:00:00 2001 From: neru Date: Tue, 13 Jan 2026 20:05:08 -0300 Subject: [PATCH] style: formatting --- src/commands/tts/messageListener.ts | 4 ++-- src/commands/tts/setchannel.ts | 36 ++++++++++++++--------------- src/modules/db.ts | 7 +----- 3 files changed, 21 insertions(+), 26 deletions(-) diff --git a/src/commands/tts/messageListener.ts b/src/commands/tts/messageListener.ts index fc39a33..fc9372c 100644 --- a/src/commands/tts/messageListener.ts +++ b/src/commands/tts/messageListener.ts @@ -44,7 +44,7 @@ class TTSListener implements Command { const guild = msg.guild; const me = guild.members.me; const member = msg.member; - + if (!me) return; if (member.voice.channelId !== me.voice.channelId) return; @@ -78,7 +78,7 @@ class TTSListener implements Command { queue.enqueue(Readable.from(audio.data)); } } catch (err) { - this.log.error('error occurred while processing TTS message (%s)', err); + this.log.error('Error occurred while processing TTS message (%s)', err); } }; diff --git a/src/commands/tts/setchannel.ts b/src/commands/tts/setchannel.ts index dc88cf3..0ac7e98 100644 --- a/src/commands/tts/setchannel.ts +++ b/src/commands/tts/setchannel.ts @@ -1,34 +1,34 @@ import { - ChatInputCommandInteraction, - MessageFlags, - SlashCommandBuilder + ChatInputCommandInteraction, + MessageFlags, + SlashCommandBuilder } from 'discord.js'; import { Command } from '../../commands'; import { DatabaseManager } from '../../modules/db'; const builder = new SlashCommandBuilder() - .setName('tts-channel') - .setDescription('Sets the channel where TTS messages will be read from'); + .setName('tts-channel') + .setDescription('Sets the channel where TTS messages will be read from'); const cmd: Command = { - name: builder.name, - builder: builder, + name: builder.name, + builder: builder, - execute: async (interaction: ChatInputCommandInteraction): Promise => { - await interaction.deferReply({ flags: MessageFlags.Ephemeral }); + execute: async (interaction: ChatInputCommandInteraction): Promise => { + await interaction.deferReply({ flags: MessageFlags.Ephemeral }); - if (!interaction.guild) { - interaction.editReply('This message can only be executed on guilds'); - return; - } + if (!interaction.guild) { + interaction.editReply('This message can only be executed on guilds'); + return; + } - const guildData = await DatabaseManager.get.getGuild(interaction.guild.id); + const guildData = await DatabaseManager.get.getGuild(interaction.guild.id); - await guildData.set('tts_channel', interaction.channelId); - await guildData.save(); + await guildData.set('tts_channel', interaction.channelId); + await guildData.save(); - interaction.editReply('TTS channel updated.'); - } + interaction.editReply('TTS channel updated.'); + } }; export default cmd; diff --git a/src/modules/db.ts b/src/modules/db.ts index 2f896bd..3f97ee2 100644 --- a/src/modules/db.ts +++ b/src/modules/db.ts @@ -1,9 +1,4 @@ -import { - DataTypes, - Model, - ModelStatic, - Sequelize -} from 'sequelize'; +import { DataTypes, Model, ModelStatic, Sequelize } from 'sequelize'; export class DatabaseManager { private readonly db: Sequelize;