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 exactly two required variables. The bot will fail to start if either is missing or invalid. Copy .env.example to .env and fill in both values before running the bot for the first time.

.env template

.env
TOKEN=your_discord_bot_token
CLIENT_ID=your_discord_application_client_id

Variables

TOKEN
string
required
Your Discord bot token. Used to authenticate the bot process with the Discord API via client.login() in src/index.ts. A token is tied to a specific bot user — if you regenerate it, you must update this value and restart the bot.
CLIENT_ID
string
required
Your Discord application’s client ID (also called the Application ID). Used by the Command.ts handler when registering slash commands with the Discord REST API. This value never changes for a given application.

How to find each value

TOKEN
  1. Go to the Discord Developer Portal.
  2. Select your application.
  3. Open the Bot page from the left sidebar.
  4. Click Reset Token (you may need to enter your 2FA code).
  5. Copy the token immediately — it is only shown once.
CLIENT_ID
  1. Go to the Discord Developer Portal.
  2. Select your application.
  3. Open the General Information page from the left sidebar.
  4. Copy the Application ID field.

Security

Never commit your .env file to version control. The project’s .gitignore already excludes it, but double-check before pushing to a public repository. Anyone who obtains your token can control your bot and access every server it is in.
If your TOKEN is invalid, expired, or was regenerated, the bot will fail to log in and exit immediately. Always update .env with the new token from the Developer Portal → Bot page after a reset.

TypeScript type safety

src/types.d.ts extends the Node.js ProcessEnv interface to declare TOKEN and CLIENT_ID as typed string properties:
src/types.d.ts
declare namespace NodeJS {
  interface ProcessEnv {
    TOKEN: string;
    CLIENT_ID: string;
  }
}
This means TypeScript will catch any typos or missing accesses to process.env.TOKEN and process.env.CLIENT_ID at compile time rather than at runtime.

Build docs developers (and LLMs) love