style: formatting
This commit is contained in:
@@ -44,7 +44,7 @@ class TTSListener implements Command {
|
|||||||
const guild = msg.guild;
|
const guild = msg.guild;
|
||||||
const me = guild.members.me;
|
const me = guild.members.me;
|
||||||
const member = msg.member;
|
const member = msg.member;
|
||||||
|
|
||||||
if (!me) return;
|
if (!me) return;
|
||||||
if (member.voice.channelId !== me.voice.channelId) return;
|
if (member.voice.channelId !== me.voice.channelId) return;
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ class TTSListener implements Command {
|
|||||||
queue.enqueue(Readable.from(audio.data));
|
queue.enqueue(Readable.from(audio.data));
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} 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 {
|
import {
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
MessageFlags,
|
MessageFlags,
|
||||||
SlashCommandBuilder
|
SlashCommandBuilder
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import { Command } from '../../commands';
|
import { Command } from '../../commands';
|
||||||
import { DatabaseManager } from '../../modules/db';
|
import { DatabaseManager } from '../../modules/db';
|
||||||
|
|
||||||
const builder = new SlashCommandBuilder()
|
const builder = new SlashCommandBuilder()
|
||||||
.setName('tts-channel')
|
.setName('tts-channel')
|
||||||
.setDescription('Sets the channel where TTS messages will be read from');
|
.setDescription('Sets the channel where TTS messages will be read from');
|
||||||
|
|
||||||
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> => {
|
||||||
await interaction.deferReply({ flags: MessageFlags.Ephemeral });
|
await interaction.deferReply({ flags: MessageFlags.Ephemeral });
|
||||||
|
|
||||||
if (!interaction.guild) {
|
if (!interaction.guild) {
|
||||||
interaction.editReply('This message can only be executed on guilds');
|
interaction.editReply('This message can only be executed on guilds');
|
||||||
return;
|
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.set('tts_channel', interaction.channelId);
|
||||||
await guildData.save();
|
await guildData.save();
|
||||||
|
|
||||||
interaction.editReply('TTS channel updated.');
|
interaction.editReply('TTS channel updated.');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default cmd;
|
export default cmd;
|
||||||
|
|||||||
+1
-6
@@ -1,9 +1,4 @@
|
|||||||
import {
|
import { DataTypes, Model, ModelStatic, Sequelize } from 'sequelize';
|
||||||
DataTypes,
|
|
||||||
Model,
|
|
||||||
ModelStatic,
|
|
||||||
Sequelize
|
|
||||||
} from 'sequelize';
|
|
||||||
|
|
||||||
export class DatabaseManager {
|
export class DatabaseManager {
|
||||||
private readonly db: Sequelize;
|
private readonly db: Sequelize;
|
||||||
|
|||||||
Reference in New Issue
Block a user