Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/slashCommands/_commands.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {ApplicationCommandData, Interaction} from 'discord.js';
import settingsCommand from './settings.command';
import voiceCommand from './voice.command';
import infoCommand from './info.command';

export interface DDCommand {
commandData: ApplicationCommandData;
Expand All @@ -11,4 +12,5 @@ export interface DDCommand {
export default [
voiceCommand,
settingsCommand,
infoCommand,
] as DDCommand[];
43 changes: 43 additions & 0 deletions src/slashCommands/info.command.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import {
ApplicationCommandData,
ApplicationCommandType,
ChatInputCommandInteraction,
PermissionsBitField,
EmbedBuilder,
} from 'discord.js';
import {logger} from '../logger';
import {DDCommand} from './_commands';


export default {
commandData: {
type: ApplicationCommandType.ChatInput,
name: 'info',
description:
'View general information and recent statistics for the ' +
'Dynamic Voices bot',
dmPermission: false,
defaultMemberPermissions: PermissionsBitField.Flags.ManageGuild,
options: [],
} as ApplicationCommandData,

commandExecutor: async (interaction: ChatInputCommandInteraction) => {
if (interaction.commandName !== 'info') {
logger.error(
`Interaction '${interaction.commandName}' got thrown into handler ` +
'for \'info\'!',
);
logger.error(Error().stack);
}

await interaction.deferReply({ephemeral: true});

const infoEmbed = new EmbedBuilder()
.setColor([1, 1, 1])
.setTitle('Dynamic Voices bot information')
.addFields({name: 'Test', value: 'testvalue', inline: true})
.toJSON();

await interaction.editReply({embeds: [infoEmbed]});
},
} as DDCommand;