DOCUMENTATION / GIVEAWAYS & POLLS
Bring everyone into it.
Built-in polls and giveaway entries stay interactive even while your bot process reconnects.
Create a giveaway
Request SendMessages, ManageEvents and UseCommands. Relay creates an entry button, stores each member’s entry once, and draws up to 20 distinct eligible members when the giveaway ends. The scheduled backend worker ends due giveaways; /end can close one early. Winner selection is random and persisted so retries do not redraw.
Only current, eligible channel members can win. The platform announces the result in the original message card and emits giveawayEnd. Prize fulfilment is your responsibility. No payment or prize transfer is performed.
const giveaway = await bot.giveaways.create(channelId, {
prize: 'A community spotlight',
winnerCount: 1,
endsAt: new Date(Date.now() + 86_400_000).toISOString()
});Ask your community
Request SendMessages, CreatePolls and UseCommands. Polls support 2–10 choices and optional multiple selection. A member can change their vote before the end time. Results return aggregate counts and the current member’s selections. Individual voter identities are not exposed by the current API, including when anonymous is false. ManagePolls is required to close a poll early.
await bot.polls.create(channelId, {
question: 'What should we do next?',
options: ['Photo walk', 'Game night', 'Meetup'],
multiple: false, anonymous: true,
endsAt: new Date(Date.now() + 3_600_000).toISOString()
});
relay