WIP few changes to class

This commit is contained in:
Marius Begby committed 2023-08-31 11:03:04 +02:00
1 parent 6d7a931f16
commit 335f4bb84e
3 files changed
+57 -61

No files matched your search

+14 -12
View File
@@ -1,25 +1,27 @@
import { EmbedBuilder, Message, SlashCommandBuilder } from 'discord.js';
import { BaseSlashCommandInteraction, BaseSlashCommandParams } from '../../../types/interactionTypes';
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
import {
BaseSlashCommandInteraction,
BaseSlashCommandParams,
BaseSlashCommandReturnType
} from '../../../types/interactionTypes';
export class TestCommandInteraction extends BaseSlashCommandInteraction {
class TestCommand extends BaseSlashCommandInteraction {
constructor() {
const data = new SlashCommandBuilder().setName('test').setDescription('Test command');
const data = new SlashCommandBuilder()
.setName('test')
.setDescription('This is a test command description lorem ipsum.');
super(data);
}
async execute(params: BaseSlashCommandParams): Promise<Message<boolean> | void> {
async execute(params: BaseSlashCommandParams): BaseSlashCommandReturnType {
const { executionId, interaction } = params;
const logger = this.getLogger('test.js', executionId, interaction);
logger.info('test command executed');
logger.info(`${interaction.user.tag} executed test command`);
logger.info(`Execution ID: ${executionId}`);
logger.info(this.embedOptions.icons.success + ' Icon success from config.');
logger.debug('Responding with success embed.');
return await interaction.editReply({
embeds: [new EmbedBuilder().setDescription('It works!').setColor(this.embedOptions.colors.success)]
embeds: [new EmbedBuilder().setDescription(`Success reply from command '${this.commandName}'.`).setColor(this.embedOptions.colors.success)]
});
}
}
export default new TestCommandInteraction();
export default new TestCommand();