style: formatting
This commit is contained in:
@@ -78,7 +78,7 @@ class TTSListener implements Command {
|
||||
queue.enqueue(Readable.from(audio.data));
|
||||
}
|
||||
} catch (err) {
|
||||
this.log.error('error occurred while processing TTS message (%s)', err);
|
||||
this.log.error('Error occurred while processing TTS message (%s)', err);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
MessageFlags,
|
||||
SlashCommandBuilder
|
||||
ChatInputCommandInteraction,
|
||||
MessageFlags,
|
||||
SlashCommandBuilder
|
||||
} from 'discord.js';
|
||||
import { Command } from '../../commands';
|
||||
import { DatabaseManager } from '../../modules/db';
|
||||
|
||||
const builder = new SlashCommandBuilder()
|
||||
.setName('tts-channel')
|
||||
.setDescription('Sets the channel where TTS messages will be read from');
|
||||
.setName('tts-channel')
|
||||
.setDescription('Sets the channel where TTS messages will be read from');
|
||||
|
||||
const cmd: Command = {
|
||||
name: builder.name,
|
||||
builder: builder,
|
||||
name: builder.name,
|
||||
builder: builder,
|
||||
|
||||
execute: async (interaction: ChatInputCommandInteraction): Promise<void> => {
|
||||
await interaction.deferReply({ flags: MessageFlags.Ephemeral });
|
||||
execute: async (interaction: ChatInputCommandInteraction): Promise<void> => {
|
||||
await interaction.deferReply({ flags: MessageFlags.Ephemeral });
|
||||
|
||||
if (!interaction.guild) {
|
||||
interaction.editReply('This message can only be executed on guilds');
|
||||
return;
|
||||
}
|
||||
if (!interaction.guild) {
|
||||
interaction.editReply('This message can only be executed on guilds');
|
||||
return;
|
||||
}
|
||||
|
||||
const guildData = await DatabaseManager.get.getGuild(interaction.guild.id);
|
||||
const guildData = await DatabaseManager.get.getGuild(interaction.guild.id);
|
||||
|
||||
await guildData.set('tts_channel', interaction.channelId);
|
||||
await guildData.save();
|
||||
await guildData.set('tts_channel', interaction.channelId);
|
||||
await guildData.save();
|
||||
|
||||
interaction.editReply('TTS channel updated.');
|
||||
}
|
||||
interaction.editReply('TTS channel updated.');
|
||||
}
|
||||
};
|
||||
|
||||
export default cmd;
|
||||
|
||||
+1
-6
@@ -1,9 +1,4 @@
|
||||
import {
|
||||
DataTypes,
|
||||
Model,
|
||||
ModelStatic,
|
||||
Sequelize
|
||||
} from 'sequelize';
|
||||
import { DataTypes, Model, ModelStatic, Sequelize } from 'sequelize';
|
||||
|
||||
export class DatabaseManager {
|
||||
private readonly db: Sequelize;
|
||||
|
||||
Reference in New Issue
Block a user