Most GiveawayBot problems fall into a small number of categories: missing Discord Developer Portal settings, permission gaps in a channel, timing edge cases from bot downtime, or a malformed input. Work through the relevant accordion below to resolve the issue.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/resynceddesign/giveawaybot/llms.txt
Use this file to discover all available pages before exploring further.
Bot fails to start — Error: Used disallowed intents
Bot fails to start — Error: Used disallowed intents
Cause: GiveawayBot requires privileged Gateway Intents (Guild Members and Message Content) that must be explicitly enabled in the Developer Portal before Discord will grant them.Fix:
- Go to the Discord Developer Portal and select your application.
- Open the Bot page from the left sidebar.
- Scroll down to Privileged Gateway Intents.
- Enable the two privileged intents: Server Members Intent and Message Content Intent. The standard Guilds and Guild Messages intents are non-privileged and do not require toggling.
- Save changes, then restart the bot.
Slash commands not showing in Discord
Slash commands not showing in Discord
Cause: Slash commands must be registered with Discord via the REST API. The
Command.ts handler does this on startup, but only after a successful build.Fix:- Run
npm run buildand confirm it completes without errors. - Restart the bot (
npm start). Watch the console for any errors during command registration. - Wait for Discord to propagate the commands — global application commands can take up to one hour to appear in all servers.
CLIENT_ID in your .env matches the Application ID for the correct Discord application.Bot is online but /gcreate does nothing
Bot is online but /gcreate does nothing
Cause: The bot is responding to the interaction but lacks the channel permissions needed to send or embed its response.Fix: In the target channel’s settings, ensure the bot’s role has the following permissions:
- Send Messages
- Embed Links
- Read Message History
Giveaway doesn't end on time
Giveaway doesn't end on time
Cause: The
processGiveaways function (started in src/events/ready.ts) runs every 1000 ms and compares createdAt + duration * 1000 against the current time. If the bot is offline when a giveaway is scheduled to end, the comparison never runs and the giveaway remains open.Fix: Keep the bot running continuously using a process manager such as PM2 or a systemd service. When the bot restarts after downtime, processGiveaways will execute immediately on the first tick and end any overdue giveaways right away.Invalid duration format error on /gcreate
Invalid duration format error on /gcreate
Cause: The duration argument is parsed by
Multi-unit durations (e.g.,
parseDuration in src/functions.ts using the regex /^(\d+)([smhd])$/. Any string that doesn’t match — including those with spaces, decimal points, or unsupported units — will fail validation.Fix: Use one of the four supported formats with no spaces or extra characters:| Format | Meaning |
|---|---|
30s | 30 seconds |
5m | 5 minutes |
2h | 2 hours |
1d | 1 day |
1h30m) are not supported. Use the next-closest single unit instead.Database errors on startup
Database errors on startup
Cause: The
better-sqlite3 attempts to open (or create) src/database/data/database.db at startup. If the src/database/data/ directory does not exist, the open call throws an error and the bot exits.Fix: Create the directory manually, then restart the bot:database.db file will be created automatically on the first run.Bot can't DM winners
Bot can't DM winners
Cause: The winner has DMs from server members disabled in their Discord privacy settings, or they have blocked the bot.This is expected behavior and is handled gracefully in the codebase — the DM error is caught and ignored. The winner is still announced publicly in the giveaway channel, so no action from the host is required. Winners can contact the host directly to claim their prize.
Token was regenerated — bot says Invalid token
Token was regenerated — bot says Invalid token
Cause: Regenerating a bot token in the Developer Portal immediately invalidates the previous token. Any running bot process using the old token will disconnect and be unable to reconnect.Fix:
- Go to Developer Portal → Bot → Reset Token and copy the new token.
- Update the
TOKENvalue in your.envfile. - Restart the bot with
npm start.
If your issue isn’t listed here, please open an issue on the GiveawayBot GitHub repository. Include the error message from your console, your Node.js version (
node -v), and the steps to reproduce the problem.