Guards
Guards are a built-in way of protecting commands.
Permissions
You can specify which users are permitted to use a command by referencing their guild permissions. These can be accessed with guards.permissions
.
import { command } from 'jellycommands';
export default command({ name: 'commandname', description: 'A short description of what the command does',
guards: { // This means only people with the Administrator permission can use the command permissions: ['Administrator'], },
run: ({ interaction }) => { // Do something with interaction },});