Register the event
Enable error in events in your ForgeTopGG options in index.js:
const { ForgeClient } = require("@tryforge/forgescript")
const { ForgeTopGG } = require("@tryforge/forge.topgg")
const topgg = new ForgeTopGG({
events: [
"error"
]
})
const client = new ForgeClient({
events: [
"clientReady"
],
intents: [
"Guilds"
],
extensions: [
topgg
]
})Handle the event
Listen and react when error is triggered using an inline command or an external handler file:
topgg.commands.add({
type: "error",
code: `$log[error event was triggered!]`
})