From 294e256febad5a8708cc211bcf48b5449d1cbfa5 Mon Sep 17 00:00:00 2001 From: neru Date: Wed, 14 Jan 2026 22:36:07 -0300 Subject: [PATCH] style: run format:apply --- src/commands/general/cmds.ts | 51 ++++++++++++++++++--------------- src/commands/general/ping.ts | 20 ++++++------- src/commands/voice/join.ts | 21 ++++++++------ src/modules/tts-modes/google.ts | 4 ++- src/modules/tts-modes/polly.ts | 3 +- 5 files changed, 54 insertions(+), 45 deletions(-) diff --git a/src/commands/general/cmds.ts b/src/commands/general/cmds.ts index 0a167b5..6358f73 100644 --- a/src/commands/general/cmds.ts +++ b/src/commands/general/cmds.ts @@ -1,32 +1,37 @@ -import { ChatInputCommandInteraction, EmbedBuilder, SlashCommandBuilder } from "discord.js"; -import { Command } from "../../commands"; -import { Bot } from "../../bot"; +import { + ChatInputCommandInteraction, + EmbedBuilder, + SlashCommandBuilder +} from 'discord.js'; +import { Command } from '../../commands'; +import { Bot } from '../../bot'; const builder = new SlashCommandBuilder() - .setName('commands') - .setDescription('Shows a list of all the commands.'); + .setName('commands') + .setDescription('Shows a list of all the commands.'); const cmd: Command = { - name: builder.name, - builder: builder, - execute: async (interaction: ChatInputCommandInteraction): Promise => { - const responseEmbed = new EmbedBuilder() - .setColor("Blurple") - .setTitle("Command List"); + name: builder.name, + builder: builder, + execute: async (interaction: ChatInputCommandInteraction): Promise => { + const responseEmbed = new EmbedBuilder() + .setColor('Blurple') + .setTitle('Command List'); - const bot = Bot.get; - bot.getCategories().forEach(({ info, commands }) => { - const fieldBody = commands - .filter(({ builder }) => builder) - .map(({ builder }) => `• **${builder?.name}** - ${builder?.description}`) - .join("\n"); + const bot = Bot.get; + bot.getCategories().forEach(({ info, commands }) => { + const fieldBody = commands + .filter(({ builder }) => builder) + .map( + ({ builder }) => `• **${builder?.name}** - ${builder?.description}` + ) + .join('\n'); - responseEmbed.addFields({ name: info.name, value: fieldBody }); - }); + responseEmbed.addFields({ name: info.name, value: fieldBody }); + }); - await interaction.reply({ embeds: [responseEmbed] }); - - } + await interaction.reply({ embeds: [responseEmbed] }); + } }; -export default cmd; \ No newline at end of file +export default cmd; diff --git a/src/commands/general/ping.ts b/src/commands/general/ping.ts index 27a7507..a603e00 100644 --- a/src/commands/general/ping.ts +++ b/src/commands/general/ping.ts @@ -1,16 +1,16 @@ -import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js"; -import { Command } from "../../commands"; +import { ChatInputCommandInteraction, SlashCommandBuilder } from 'discord.js'; +import { Command } from '../../commands'; const builder = new SlashCommandBuilder() - .setName('ping') - .setDescription('Pong.'); + .setName('ping') + .setDescription('Pong.'); const cmd: Command = { - name: builder.name, - builder: builder, - execute: async (interaction: ChatInputCommandInteraction): Promise => { - interaction.reply('pong!'); - } + name: builder.name, + builder: builder, + execute: async (interaction: ChatInputCommandInteraction): Promise => { + interaction.reply('pong!'); + } }; -export default cmd; \ No newline at end of file +export default cmd; diff --git a/src/commands/voice/join.ts b/src/commands/voice/join.ts index 3192df4..44c0cc6 100644 --- a/src/commands/voice/join.ts +++ b/src/commands/voice/join.ts @@ -42,15 +42,18 @@ const cmd: Command = { } const voiceChannel = member.voice.channel; - if (voiceChannel.userLimit != 0 && voiceChannel.members.size >= voiceChannel.userLimit) { + if ( + voiceChannel.userLimit != 0 && + voiceChannel.members.size >= voiceChannel.userLimit + ) { interaction.reply('Channel is full'); return; } - const perms = voiceChannel.permissionsFor(me) + const perms = voiceChannel.permissionsFor(me); if (!perms.has(PermissionsBitField.Flags.ViewChannel)) { - interaction.reply("I don't have permissions to see that channel") + interaction.reply("I don't have permissions to see that channel"); return; } @@ -60,16 +63,16 @@ const cmd: Command = { } if (!perms.has(PermissionsBitField.Flags.Speak)) { - interaction.reply("I don't have permissions to speak on that channel") + interaction.reply("I don't have permissions to speak on that channel"); return; } const voiceOptions: JoinVoiceChannelOptions & CreateVoiceConnectionOptions = - { - channelId: member.voice.channelId, - guildId: interaction.guild.id, - adapterCreator: interaction.guild.voiceAdapterCreator - }; + { + channelId: member.voice.channelId, + guildId: interaction.guild.id, + adapterCreator: interaction.guild.voiceAdapterCreator + }; const connection = await joinVoiceChannel(voiceOptions); if (!connection) { diff --git a/src/modules/tts-modes/google.ts b/src/modules/tts-modes/google.ts index b450b07..69dfc2e 100644 --- a/src/modules/tts-modes/google.ts +++ b/src/modules/tts-modes/google.ts @@ -11,7 +11,9 @@ const ttsGoogle: TTSModule = { name: 'Google', defaultVoice: 'en', - async getVoices(): Promise { return GOOGLE_TTS_VOICES.voices }, + async getVoices(): Promise { + return GOOGLE_TTS_VOICES.voices; + }, async generate(voice: string, text: string): Promise { const query = new URLSearchParams({ diff --git a/src/modules/tts-modes/polly.ts b/src/modules/tts-modes/polly.ts index 5d8e617..8e48fcf 100644 --- a/src/modules/tts-modes/polly.ts +++ b/src/modules/tts-modes/polly.ts @@ -83,8 +83,7 @@ class PollyTTS implements TTSModule { } canBeUsed(): boolean { - if (!config.aws_access_id || !config.aws_access_key) - return false; + if (!config.aws_access_id || !config.aws_access_key) return false; return true; }