style: run format:apply
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
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')
|
||||||
@@ -11,21 +15,22 @@ const cmd: Command = {
|
|||||||
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] });
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
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')
|
||||||
|
|||||||
@@ -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,7 +63,7 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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({
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user