Prefix Commands

Create classic prefix-based commands with cooldown and permission support.

Example Usage

Create it inside commands/prefix/admin.ts.

1import { PrefixCommand } from 'discordjs-nextgen';
2
3const adminCommand: PrefixCommand = {
4 name: 'clear',
5 aliases: ['purge', 'wipe'],
6 usage: 'clear <amount>',
7 category: 'admin',
8 cooldown: 5,
9 permissions: ['ManageMessages'],
10 run: async (ctx, args) => {
11 const amount = parseInt(args[0]) || 10;
12 await ctx.reply(`${amount} messages are being removed...`);
13 },
14};
15
16export default adminCommand;

Features

  • Multiple aliases per command.
  • Command-specific cooldowns.
  • Permission checks through permissions.
  • Easy access to args and ctx.args.