Reroll
Triggered when giveaway winners are rerolled
Event Type
"giveaway.reroll"Description
This event is triggered when winners are rerolled, from the bot or from the dashboard. It carries only the winners this reroll drew. The winners the giveaway ended with went out with giveaway.end.
Payload Structure
Prop
Type
Example Payload
{
"type": "giveaway.reroll",
"payload": {
"giveawayId": "hT7pLm2Qa9",
"prize": "Nitro Classic",
"channelId": "1140972530400776294",
"messageId": "1141002938471829504",
"messageUrl": "https://discord.com/channels/1140972530400776290/1140972530400776294/1141002938471829504",
"newWinners": ["1140972530400776299"]
}
}Example Usage
app.post('/webhook', (req, res) => {
const { type, payload } = req.body;
if (type === 'giveaway.reroll') {
console.log(`Rerolled ${payload.prize}`);
// Hand the prize to whoever replaced the old winner
for (const userId of payload.newWinners) {
await grantReward(userId, payload.prize);
}
}
res.status(200).send('OK');
});Use Cases
- Hand a prize to a replacement winner without watching Discord
- Keep an external winner list in sync after a reroll
- Audit how often winners are rerolled