Class SlashCommand

Represents a slash command

Constructors

Properties

Constructors

  • Creates a new slash command

    Parameters

    Returns SlashCommand

    Example

    module.exports.default = new SlashCommand({
    data: {
    name: 'ping',
    description: 'Shows the bot latency'
    },
    cooldownSeconds: 2
    }, async (client, interaction) => {
    await interaction.reply(`🏓 Pong! ${client.ws.ping}ms`);
    });

    Example

    module.exports.default = new SlashCommand({
    data:
    new SlashCommandBuilder()
    .setName('ping')
    .setDescription('Shows the bot latency'),
    cooldownSeconds: 2
    }, async (client, interaction) => {
    await interaction.reply(`🏓 Pong! ${client.ws.ping}ms`);
    });

Properties

The callback for the command

cooldowns: CooldownCollection = ...

The cooldowns for this command

The options for the command

Generated using TypeDoc