mirror of
https://github.com/ahmadk953/poixpixel-discord-bot.git
synced 2025-05-11 19:23:06 +00:00
Refactored Command Deployment, Organized Code, and Fixed Linting
This commit is contained in:
parent
327035d883
commit
d8df48438d
9 changed files with 77 additions and 63 deletions
19
src/commands/util/server.ts
Normal file
19
src/commands/util/server.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { SlashCommandBuilder, CommandInteraction } from 'discord.js';
|
||||
|
||||
interface Command {
|
||||
data: Omit<SlashCommandBuilder, 'addSubcommand' | 'addSubcommandGroup'>;
|
||||
execute: (interaction: CommandInteraction) => Promise<void>;
|
||||
}
|
||||
|
||||
const command: Command = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('server')
|
||||
.setDescription('Provides information about the server.'),
|
||||
execute: async (interaction) => {
|
||||
await interaction.reply(
|
||||
`The server ${interaction!.guild!.name} has ${interaction!.guild!.memberCount} members and was created on ${interaction!.guild!.createdAt}. It is ${new Date().getFullYear() - interaction!.guild!.createdAt.getFullYear()!} years old.`
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default command;
|
Loading…
Add table
Add a link
Reference in a new issue