Register the event
Enable giveawayEntryAdd 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: [
"giveawayEntryAdd"
]
})
const client = new ForgeClient({
events: [
"clientReady"
],
intents: [
"Guilds"
],
extensions: [
giveaways
]
})Handle the event
Listen and react when giveawayEntryAdd is triggered using an inline command or an external handler file:
giveaways.commands.add({
type: "giveawayEntryAdd",
code: `$log[giveawayEntryAdd event was triggered!]`
})