Giveaways - CosmicCubicle/PariahBot GitHub Wiki

Giveaways

Timed giveaways that members enter with a button. Winners are drawn automatically when the time is up.


Run one (admins)

Run this in the channel where the giveaway should appear:

/giveaway create prize:Discord Nitro duration:1440 winners:2
Option Limits
prize Up to 256 characters
duration In minutes, from 1 to 43,200 (30 days). 60 is an hour, 1440 a day
winners 1 to 20

The reply gives the giveaway's ID. Keep it if you might want to end it early.

End one early:

/giveaway end id:<the ID>

Winners are drawn right away, just as if the time had run out.


How it works

  • The post shows the prize, the number of winners, an Enter giveaway button and a running entry count.
  • Entering: members press the button. Pressing again just says they're already entered. Each member counts once.
  • When it ends:
    • The post changes to Ended: prize and the button is removed.
    • A message names the winners: "Congratulations @A, @B! You won Discord Nitro."
    • With no entries, it says so instead.
  • Winners are drawn at random, with a secure random generator, from everyone who entered. There can't be more winners than entries.
  • Restarts are fine. Giveaways survive a restart, and one that should have ended while the bot was offline ends as soon as it starts.

Troubleshooting

What happens Fix
"That giveaway does not exist or has already ended" Check the ID from the creation reply. It may already be over
"Giveaway could not be posted" The bot needs Send Messages and Embed Links in that channel
The post didn't update when it ended The bot needs Read Message History to find it again. Winners are still announced

/giveaway commands are for staff (mods and admins). Entering is open to everyone. Permissions needed: Send Messages, Embed Links and Read Message History. See Permissions.

⚠️ **GitHub.com Fallback** ⚠️