MessageContextCommand
const { MessageContextCommand } = require('commandkit-helper')
module.exports = new MessageContextCommand()
.setData({
name: 'ping',
description: 'Pong!'
})
.setRun(async ({ interaction, client, handler }) => {
})
import { MessageContextCommand } from 'commandkit-helper'
export default new MessageContextCommand()
.setData({
name: 'ping',
description: 'Pong!'
})
.setRun(async ({ interaction, client, handler }) => {
})
Properties
data
- Type:
AnyContextCommandData
options
- Type:
CommandOptions
run
Methods
setRun(run)
Sets the function to be executed when the command is used.
- Parameters:
- Returns: The modified
MessageContextCommand
.
setData(data)
Sets the data for the slash command.
- Parameters:
data
:AnyContextCommandData
- Returns: The modified
MessageContextCommand
.
setDevOnly(devOnly)
Sets whether the command is for development purposes only.
- Parameters:
devOnly
:boolean
- Returns: The modified
MessageContextCommand
.
setGuildOnly(guildOnly)
Sets whether the command can only be used in guilds (servers).
- Parameters:
guildOnly
:boolean
- Returns: The modified
MessageContextCommand
.
setUserPermissions(userPermissions)
Sets the required user permissions to use the command.
- Parameters:
userPermissions
:PermissionResolvable
- Returns: The modified
MessageContextCommand
.
setBotPermissions(botPermissions)
Sets the required bot permissions to execute the command.
- Parameters:
botPermissions
:PermissionResolvable
- Returns: The modified
MessageContextCommand
.
setDeleted(deleted)
Sets whether the command is deleted.
- Parameters:
deleted
:boolean
- Returns: The modified
MessageContextCommand
.