You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It does not work properly and gives errors, Even when I use the exact code of the example:
C:\Users\user\Desktop\bot\commands\ping.ts:20
if (error === CommandErrors.COMMAND_DISABLED) {
^
TypeError: Cannot read properties of undefined (reading 'COMMAND_DISABLED')
at error (C:\Users\user\Desktop\bot\commands\ping.ts:20:33)
at module.exports (C:\Users\user\Desktop\bot\node_modules\wokcommands\dist\command-checks\is-enabled.js:12:9)
at Client.<anonymous> (C:\Users\user\Desktop\bot\node_modules\wokcommands\dist\CommandHandler.js:119:33)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
[nodemon] app crashed - waiting for file changes before starting...
Here is the code:
import{MessageEmbed}from"discord.js";import{ICommand,CommandErrors}from"wokcommands";exportdefault{// Best practice for the built-in help menucategory: "Testing",description: 'Replies with "Pong!"',testOnly: true,slash: "both",// Invoked when the command is actually rancallback: ({ message })=>{message.reply({content: "Pong!",});},// Invoked when there is an error when running this commanderror: ({ error, command, message, info })=>{// "error" holds one of the strings mentioned in the above listif(error===CommandErrors.COMMAND_DISABLED){// For example we can now create and send a custom embedconstembed=newMessageEmbed().setTitle("Command disabled").setColor(0xff0000);message.reply({embeds: [embed],});}},}asICommand;
It does not work properly and gives errors, Even when I use the exact code of the example:
Here is the code:
https://docs.wornoffkeys.com/commands/handling-command-errors
The text was updated successfully, but these errors were encountered: