From 2ec7212cd33c5f92728a65a8f6decc6750b00bb7 Mon Sep 17 00:00:00 2001 From: neru Date: Tue, 13 Jan 2026 17:53:31 -0300 Subject: [PATCH] style: run format:apply --- src/commands/voice/_category.ts | 4 +- src/commands/voice/join.ts | 85 +++++++++++++++++------------- src/commands/voice/leave.ts | 52 +++++++++--------- src/commands/voice/userListener.ts | 37 ++++++------- src/modules/tts-modes/google.ts | 2 +- 5 files changed, 97 insertions(+), 83 deletions(-) diff --git a/src/commands/voice/_category.ts b/src/commands/voice/_category.ts index b2742d7..f80de3c 100644 --- a/src/commands/voice/_category.ts +++ b/src/commands/voice/_category.ts @@ -1,8 +1,8 @@ import { CommandCategoryInfo } from '../../commands'; const info: CommandCategoryInfo = { - name: 'Voice', - description: 'Voice chat related commands' + name: 'Voice', + description: 'Voice chat related commands' }; export default info; diff --git a/src/commands/voice/join.ts b/src/commands/voice/join.ts index afd9679..14488a3 100644 --- a/src/commands/voice/join.ts +++ b/src/commands/voice/join.ts @@ -1,47 +1,60 @@ -import { ChatInputCommandInteraction, GuildMember, SlashCommandBuilder } from "discord.js"; -import { Command } from "../../commands"; -import { CreateVoiceConnectionOptions, getVoiceConnection, joinVoiceChannel, JoinVoiceChannelOptions } from "@discordjs/voice"; +import { + ChatInputCommandInteraction, + GuildMember, + SlashCommandBuilder +} from 'discord.js'; +import { Command } from '../../commands'; +import { + CreateVoiceConnectionOptions, + getVoiceConnection, + joinVoiceChannel, + JoinVoiceChannelOptions +} from '@discordjs/voice'; const builder = new SlashCommandBuilder() - .setName("join") - .setDescription("Makes the bot join your current voice channel"); + .setName('join') + .setDescription('Makes the bot join your current voice channel'); const cmd: Command = { - name: builder.name, - builder: builder, - execute: async (interaction: ChatInputCommandInteraction): Promise => { - const member = interaction.member as GuildMember; - if (!member || !interaction.guild) { - interaction.reply("This command only works on guilds"); - return; - } + name: builder.name, + builder: builder, + execute: async (interaction: ChatInputCommandInteraction): Promise => { + const member = interaction.member as GuildMember; + if (!member || !interaction.guild) { + interaction.reply('This command only works on guilds'); + return; + } - if (!member.voice.channelId) { - interaction.reply("You are not currently on a voice channel"); - return; - } + if (!member.voice.channelId) { + interaction.reply('You are not currently on a voice channel'); + return; + } - const me = interaction.guild.members.me as GuildMember; + const me = interaction.guild.members.me as GuildMember; - if (getVoiceConnection(interaction.guild.id) && me.voice.channelId === member.voice.channelId) { - interaction.reply("Already connected"); - return; - } + if ( + getVoiceConnection(interaction.guild.id) && + me.voice.channelId === member.voice.channelId + ) { + interaction.reply('Already connected'); + return; + } - const voiceOptions: JoinVoiceChannelOptions & CreateVoiceConnectionOptions = { - channelId: member.voice.channelId, - guildId: interaction.guild.id, - adapterCreator: interaction.guild.voiceAdapterCreator - }; + const voiceOptions: JoinVoiceChannelOptions & CreateVoiceConnectionOptions = + { + channelId: member.voice.channelId, + guildId: interaction.guild.id, + adapterCreator: interaction.guild.voiceAdapterCreator + }; - const connection = await joinVoiceChannel(voiceOptions); - if (!connection) { - interaction.reply("Unable to join"); - return - } + const connection = await joinVoiceChannel(voiceOptions); + if (!connection) { + interaction.reply('Unable to join'); + return; + } - interaction.reply("Joined"); - } -} + interaction.reply('Joined'); + } +}; -export default cmd; \ No newline at end of file +export default cmd; diff --git a/src/commands/voice/leave.ts b/src/commands/voice/leave.ts index 511a9e0..1a43a5f 100644 --- a/src/commands/voice/leave.ts +++ b/src/commands/voice/leave.ts @@ -1,32 +1,36 @@ -import { ChatInputCommandInteraction, GuildMember, SlashCommandBuilder } from "discord.js"; -import { Command } from "../../commands"; -import { getVoiceConnection } from "@discordjs/voice"; +import { + ChatInputCommandInteraction, + GuildMember, + SlashCommandBuilder +} from 'discord.js'; +import { Command } from '../../commands'; +import { getVoiceConnection } from '@discordjs/voice'; const builder = new SlashCommandBuilder() - .setName("leave") - .setDescription("Makes the bot leave its current voice channel"); + .setName('leave') + .setDescription('Makes the bot leave its current voice channel'); const cmd: Command = { - name: builder.name, - builder: builder, - execute: async (interaction: ChatInputCommandInteraction): Promise => { - const member = interaction.member as GuildMember; - if (!member || interaction.guild === null) { - interaction.reply("This command only works on guilds"); - return; - } + name: builder.name, + builder: builder, + execute: async (interaction: ChatInputCommandInteraction): Promise => { + const member = interaction.member as GuildMember; + if (!member || interaction.guild === null) { + interaction.reply('This command only works on guilds'); + return; + } - const connection = getVoiceConnection(interaction.guildId as string); - if (!connection) { - interaction.reply('currently not connected to a voice channel') - return; - } + const connection = getVoiceConnection(interaction.guildId as string); + if (!connection) { + interaction.reply('currently not connected to a voice channel'); + return; + } - connection.disconnect(); - connection.destroy(); + connection.disconnect(); + connection.destroy(); - interaction.reply("Disconnected"); - } -} + interaction.reply('Disconnected'); + } +}; -export default cmd; \ No newline at end of file +export default cmd; diff --git a/src/commands/voice/userListener.ts b/src/commands/voice/userListener.ts index 7ba7215..dc82129 100644 --- a/src/commands/voice/userListener.ts +++ b/src/commands/voice/userListener.ts @@ -1,28 +1,25 @@ -import { VoiceState } from "discord.js"; -import { Command } from "../../commands"; -import { getVoiceConnection } from "@discordjs/voice"; +import { VoiceState } from 'discord.js'; +import { Command } from '../../commands'; +import { getVoiceConnection } from '@discordjs/voice'; const cmd: Command = { - voiceStateListener: async function (oldState: VoiceState): Promise { - const guild = oldState.guild; - if (!guild) return; + voiceStateListener: async function (oldState: VoiceState): Promise { + const guild = oldState.guild; + if (!guild) return; - const voiceConnection = getVoiceConnection(guild.id); - if (!voiceConnection) return; + const voiceConnection = getVoiceConnection(guild.id); + if (!voiceConnection) return; - const me = guild.members.me; - if (!me) - return; + const me = guild.members.me; + if (!me) return; - if (!me.voice.channel) - return; + if (!me.voice.channel) return; - if (me.voice.channel.members.size > 1) - return; + if (me.voice.channel.members.size > 1) return; - voiceConnection.disconnect(); - voiceConnection.destroy(); - } -} + voiceConnection.disconnect(); + voiceConnection.destroy(); + } +}; -export default cmd; \ No newline at end of file +export default cmd; diff --git a/src/modules/tts-modes/google.ts b/src/modules/tts-modes/google.ts index ded8983..b50185e 100644 --- a/src/modules/tts-modes/google.ts +++ b/src/modules/tts-modes/google.ts @@ -44,4 +44,4 @@ const ttsGoogle: TTSModule = { } }; -export default ttsGoogle; \ No newline at end of file +export default ttsGoogle;