command

Making commands

  • For making a command first make a folder commands/

  • now in the folder, make a file! Example: ping.js

  • now add this codes in it!

Making commands!

module.exports = {
    name: 'ping',
    description: 'Shows latency ping!',
    options: [],
    run: async({ interaction, client, args, reply, editReply }) => {
        let r = await reply({ content: "hi" + interaction.member }) //interaction will be slash interaction when user uses slash command but if users uses normal then interaction will me message!
    }
}

Arguments in command!

module.exports = {
    name: 'say',
    description: 'Shows latency ping!',
    options: [{
        name: 'input',
        type: 'STRING',
        description: 'The input to echo back',
        required: true,
    }],
    run: async({ interaction, client, args, reply, editReply }) => {
        let r = await reply({ content: "hi" + interaction.member }) //interaction will be slash interaction when user uses slash command but if users uses normal then interaction will me message!
        await editReply(r, { content: "hello"})
    }
}

All types of arguments

context menu

user Permissions

client Permissions

bot owner only

Last updated