mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 14:38:49 +00:00
WIP few changes to class
This commit is contained in:
1 parent
6d7a931f16
commit
335f4bb84e
3 files changed
+57
-61
No files matched your search
@@ -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();
|
||||
Reference in new issue
Block a user