User Commands
User Commands are simple commands that lets you perform a specific action on a user.
Unlike Slash Commands, the names for these commands can contain mixed cases and spaces.
Since these commands are very basic by design, the scope of the actions they can perform are extremely specific, but very convenient to execute.
These commands live in the users
directory, and use the defineUserCommand
Definition Function for type support.
TIP
For more advanced uses, visit the Setup Method guide.
Basic Command
import { defineUserCommand } from 'chooksie'
export default defineUserCommand({
name: 'High Five',
async execute(ctx) {
const user = ctx.interaction.user
const target = ctx.interaction.targetUser
await ctx.interaction.reply(`${user} High Fived ${target}!`)
},
})
import { defineUserCommand } from 'chooksie'
export default defineUserCommand({
name: 'High Five',
async execute(ctx) {
const user = ctx.interaction.user
const target = ctx.interaction.targetUser
await ctx.interaction.reply(`${user} High Fived ${target}!`)
},
})
const { defineUserCommand } = require('chooksie')
module.exports = defineUserCommand({
name: 'High Five',
async execute(ctx) {
const user = ctx.interaction.user
const target = ctx.interaction.targetUser
await ctx.interaction.reply(`${user} High Fived ${target}!`)
},
})