Skip to main content

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.

GiveawayBot reads its configuration from a .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

VariableRequiredDescription
TOKENYesDiscord bot token used to authenticate the bot with the Discord gateway.
CLIENT_IDYesDiscord application ID used for registering slash commands.

.env template

.env
TOKEN=
CLIENT_ID=
Fill in each value after the = sign with no spaces and no quotes.
Never share your TOKEN publicly or commit it to version control. Anyone with your bot token can take full control of your bot. If your token is ever exposed, go to the Bot page on the Developer Portal and click Reset Token immediately.

Where to find your credentials

1

Open the Discord Developer Portal

Go to discord.com/developers/applications and sign in with your Discord account.
2

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.
3

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.
4

Get your bot token

In the left sidebar, click Bot. Under the Token section, click Reset Token (you may need to confirm with your 2FA code). Copy the token and paste it into TOKEN in your .env file.
The token is only shown once. If you navigate away without copying it, you will need to reset it again.

Gateway intents

GiveawayBot requires four Discord gateway intents. These must be enabled both in your code (already configured in src/index.ts) and on the Discord Developer Portal under your application’s Bot page.
IntentWhy it is needed
GuildsReads guild and channel information, required to respond in the correct channel.
MessageContentRequired by the message event handler to access message content.
GuildMessagesDetects message events within guild channels.
GuildMembersResolves member objects when selecting giveaway winners.

Enabling intents on the Developer Portal

1

Go to the Bot page

In your application on the Discord Developer Portal, click Bot in the left sidebar.
2

Enable privileged intents

Scroll down to the Privileged Gateway Intents section. Enable all of the following toggles:
  • Server Members Intent
  • Message Content Intent
The standard Guilds and GuildMessages intents are non-privileged and are enabled by default.
3

Save your changes

Click Save Changes at the bottom of the page. The intents take effect immediately — no bot restart required for this step.
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.

Build docs developers (and LLMs) love