Client.slashCommand() - shysolocup/noscord.js GitHub Wiki

creates a new global Slash Command

works the same as CommandService.createSlash()

Function Sync

Arguments:

  • name String
    name of the command

  • description String
    description of the command

  • ?options Array
    array of arguments for the command

  • ?cooldown String or Number
    cooldown on the command either using time parsing or just a number
    can be formatted like "1m" or just 60

  • ?nsfw Boolean
    if the command is not safe for work or not
    defaults to false

  • callback Function
    what the command does when ran

  • ?data Object
    all of the data for the command in an object instead of just in arguments



JS
client.slashCommand("example", "example command", async (ctx) => {      
    console.log(ctx);
});


⚠️ **GitHub.com Fallback** ⚠️