Sign In

error

This event is fired when an error happens on the client

v1.0.1+

Register the event

Enable error in events in your ForgeClient options in index.js:

const { ForgeClient } = require("@tryforge/forgescript")

const client = new ForgeClient({
  events: [
    "error"
  ],
  intents: [
    "Guilds"
  ]
})

Handle the event

Listen and react when error is triggered using an inline command or an external handler file:

client.commands.add({
  type: "error",
  code: `$log[error event was triggered!]`
})

Was this page helpful?