Skip to content

UserContextCommand

const { UserContextCommand } = require('commandkit-helper')

module.exports = new UserContextCommand()
  .setData({
    name: 'ping',
    description: 'Pong!'
  })
  .setRun(async ({ interaction, client, handler }) => {

  })

Properties

data

options

run

Methods

setRun(run)

Sets the function to be executed when the command is used.

setData(data)

Sets the data for the slash command.

setDevOnly(devOnly)

Sets whether the command is for development purposes only.

  • Parameters:
    • devOnly: boolean
  • Returns: The modified UserContextCommand.

setGuildOnly(guildOnly)

Sets whether the command can only be used in guilds (servers).

  • Parameters:
    • guildOnly: boolean
  • Returns: The modified UserContextCommand.

setUserPermissions(userPermissions)

Sets the required user permissions to use the command.

setBotPermissions(botPermissions)

Sets the required bot permissions to execute the command.

setDeleted(deleted)

Sets whether the command is deleted.

  • Parameters:
    • deleted: boolean
  • Returns: The modified UserContextCommand.