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