style: run format:apply

This commit is contained in:
2026-01-13 17:53:31 -03:00
parent 83569a27e7
commit 2ec7212cd3
5 changed files with 97 additions and 83 deletions
+49 -36
View File
@@ -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<void> => {
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<void> => {
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;
export default cmd;