Overview
This document provides guidance on setting up a Discord bot that indexes posts and a front-end app. It covers installing dependencies, configuring environment variables, and creating .env files. Specific environment variables for both the web app and bot app are outlined, along with their descriptions and requirements.
Features
- DATABASE_URL: Read-only connection string to access the DB for querying posts and messages (required)
- REVALIDATE_SECRET: Secret enabling remote revalidations to the app cache, also used in the bot app (required)
- NEXT_PUBLIC_BASE_URL: Host URL of the app (optional)
- DISCORD_BOT_TOKEN: Bot token required for the bot to function
- DISCORD_CLIENT_ID: Client ID of the bot app
- DEV_GUILD_ID: Discord server ID for registering dev commands (optional)
- PUBLIC_PROFILE_ROLE_ID: Role ID for making Discord profiles public
- HELPER_ROLE_ID: Role ID allowing selection of answers on behalf of the owner
- MODERATOR_ROLE_ID: Role ID for setting moderator status and answer selection
- REGULAR_MEMBER_ROLE_ID: Role ID added to users upon reaching certain points milestone
- INDEXABLE_CHANNEL_IDS: Comma-separated list of forum channels to index
- MOD_LOG_CHANNEL_ID: Channel ID for logging activities for moderators
- DATABASE_URL: Connection string for DB access
Installation
- For the web and bot apps, create .env files in each folder.
- Set the required environment variables as specified in the documentation.
For the web app:
DATABASE_URL=your_connection_string_here
REVALIDATE_SECRET=your_revalidate_secret
NEXT_PUBLIC_BASE_URL=your_hosted_URL
For the bot app:
DISCORD_BOT_TOKEN=your_bot_token
DISCORD_CLIENT_ID=your_client_id
DEV_GUILD_ID=your_discord_server_id (if applicable)
PUBLIC_PROFILE_ROLE_ID=your_role_id
HELPER_ROLE_ID=your_role_id
MODERATOR_ROLE_ID=your_role_id
REGULAR_MEMBER_ROLE_ID=your_role_id
INDEXABLE_CHANNEL_IDS=your_comma_separated_channel_ids
MOD_LOG_CHANNEL_ID=your_channel_id
DATABASE_URL=your_connection_string_here
Summary
This document details the setup process for a Discord bot and front-end app, including installing dependencies, configuring environment variables, and creating necessary .env files. It outlines the key environment variables required for both the web and bot apps, providing descriptions and whether they are mandatory. Following the provided steps will enable users to set up and run the applications successfully.