style: run format:apply

This commit is contained in:
2026-01-14 22:36:07 -03:00
parent c005bc0e54
commit 294e256feb
5 changed files with 54 additions and 45 deletions
+28 -23
View File
@@ -1,32 +1,37 @@
import { ChatInputCommandInteraction, EmbedBuilder, SlashCommandBuilder } from "discord.js"; import {
import { Command } from "../../commands"; ChatInputCommandInteraction,
import { Bot } from "../../bot"; EmbedBuilder,
SlashCommandBuilder
} from 'discord.js';
import { Command } from '../../commands';
import { Bot } from '../../bot';
const builder = new SlashCommandBuilder() const builder = new SlashCommandBuilder()
.setName('commands') .setName('commands')
.setDescription('Shows a list of all the commands.'); .setDescription('Shows a list of all the commands.');
const cmd: Command = { const cmd: Command = {
name: builder.name, name: builder.name,
builder: builder, builder: builder,
execute: async (interaction: ChatInputCommandInteraction): Promise<void> => { execute: async (interaction: ChatInputCommandInteraction): Promise<void> => {
const responseEmbed = new EmbedBuilder() const responseEmbed = new EmbedBuilder()
.setColor("Blurple") .setColor('Blurple')
.setTitle("Command List"); .setTitle('Command List');
const bot = Bot.get; const bot = Bot.get;
bot.getCategories().forEach(({ info, commands }) => { bot.getCategories().forEach(({ info, commands }) => {
const fieldBody = commands const fieldBody = commands
.filter(({ builder }) => builder) .filter(({ builder }) => builder)
.map(({ builder }) => `• **${builder?.name}** - ${builder?.description}`) .map(
.join("\n"); ({ 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; export default cmd;
+10 -10
View File
@@ -1,16 +1,16 @@
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js"; import { ChatInputCommandInteraction, SlashCommandBuilder } from 'discord.js';
import { Command } from "../../commands"; import { Command } from '../../commands';
const builder = new SlashCommandBuilder() const builder = new SlashCommandBuilder()
.setName('ping') .setName('ping')
.setDescription('Pong.'); .setDescription('Pong.');
const cmd: Command = { const cmd: Command = {
name: builder.name, name: builder.name,
builder: builder, builder: builder,
execute: async (interaction: ChatInputCommandInteraction): Promise<void> => { execute: async (interaction: ChatInputCommandInteraction): Promise<void> => {
interaction.reply('pong!'); interaction.reply('pong!');
} }
}; };
export default cmd; export default cmd;
+12 -9
View File
@@ -42,15 +42,18 @@ const cmd: Command = {
} }
const voiceChannel = member.voice.channel; 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'); interaction.reply('Channel is full');
return; return;
} }
const perms = voiceChannel.permissionsFor(me) const perms = voiceChannel.permissionsFor(me);
if (!perms.has(PermissionsBitField.Flags.ViewChannel)) { 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; return;
} }
@@ -60,16 +63,16 @@ const cmd: Command = {
} }
if (!perms.has(PermissionsBitField.Flags.Speak)) { 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; return;
} }
const voiceOptions: JoinVoiceChannelOptions & CreateVoiceConnectionOptions = const voiceOptions: JoinVoiceChannelOptions & CreateVoiceConnectionOptions =
{ {
channelId: member.voice.channelId, channelId: member.voice.channelId,
guildId: interaction.guild.id, guildId: interaction.guild.id,
adapterCreator: interaction.guild.voiceAdapterCreator adapterCreator: interaction.guild.voiceAdapterCreator
}; };
const connection = await joinVoiceChannel(voiceOptions); const connection = await joinVoiceChannel(voiceOptions);
if (!connection) { if (!connection) {
+3 -1
View File
@@ -11,7 +11,9 @@ const ttsGoogle: TTSModule = {
name: 'Google', name: 'Google',
defaultVoice: 'en', defaultVoice: 'en',
async getVoices(): Promise<string[]> { return GOOGLE_TTS_VOICES.voices }, async getVoices(): Promise<string[]> {
return GOOGLE_TTS_VOICES.voices;
},
async generate(voice: string, text: string): Promise<TTSResponse> { async generate(voice: string, text: string): Promise<TTSResponse> {
const query = new URLSearchParams({ const query = new URLSearchParams({
+1 -2
View File
@@ -83,8 +83,7 @@ class PollyTTS implements TTSModule {
} }
canBeUsed(): boolean { canBeUsed(): boolean {
if (!config.aws_access_id || !config.aws_access_key) if (!config.aws_access_id || !config.aws_access_key) return false;
return false;
return true; return true;
} }