GiveawayBot reads its configuration from aDocumentation 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.
.env file in the project root. There are two required values: your bot token and your application’s client ID. Both are available from the Discord Developer Portal.
Environment variables
| Variable | Required | Description |
|---|---|---|
TOKEN | Yes | Discord bot token used to authenticate the bot with the Discord gateway. |
CLIENT_ID | Yes | Discord application ID used for registering slash commands. |
.env template
.env
= sign with no spaces and no quotes.
Where to find your credentials
Open the Discord Developer Portal
Go to discord.com/developers/applications and sign in with your Discord account.
Select your application
Click the application you created for GiveawayBot. If you have not created one yet, click New Application, enter a name, and confirm.
Copy your Client ID
On the General Information page, find the Application ID field. Click Copy and paste the value into
CLIENT_ID in your .env file.Gateway intents
GiveawayBot requires four Discord gateway intents. These must be enabled both in your code (already configured insrc/index.ts) and on the Discord Developer Portal under your application’s Bot page.
| Intent | Why it is needed |
|---|---|
Guilds | Reads guild and channel information, required to respond in the correct channel. |
MessageContent | Required by the message event handler to access message content. |
GuildMessages | Detects message events within guild channels. |
GuildMembers | Resolves member objects when selecting giveaway winners. |
Enabling intents on the Developer Portal
Go to the Bot page
In your application on the Discord Developer Portal, click Bot in the left sidebar.
Enable privileged intents
Scroll down to the Privileged Gateway Intents section. Enable all of the following toggles:
- Server Members Intent
- Message Content Intent
Guilds and GuildMessages intents are non-privileged and are enabled by default.If the bot crashes on startup with an error about missing intents, double-check that both privileged intents are toggled on and that you have saved the changes on the Developer Portal.