To run the Discord bot and configure deployment settings, you need to set the following environment variables:
DISCORD_BOT_TOKEN = "Nzk5Mjgx0NDc2NDU1OTYABS5g.2lmzlZv3vUaKPQi2wI"
DEPLOYMENT_ENV = "prod" # prod | beta
MONGODB_CONNECTION_URL = "mongodb connection url"
COZE_PERSONAL_ACCESS_TOKEN = ""
COZE_BOT_ID = ""
OPENAI_API_KEY = ""
DISCORD_BOT_TOKEN
: Your Discord bot token.DEPLOYMENT_ENV
: The environment where the bot will be deployed, should be either "beta" or "prod".MONGODB_CONNECTION_URL
: Your MongoDB connection URL.COZE_PERSONAL_ACCESS_TOKEN
: Your Coze personal access token.COZE_BOT_ID
: Your Coze bot id. (The number after the bot parameter is the bot ID.https://www.coze.com/space/73428668341****/bot/73428668*****
)OPENAI_API_KEY
: Your OpenAI api key.
Additionally, you need to create two environment files: .env.prod
and .env.beta
under the config
directory with
the following variables:
GUILD_IDS = 250892094615837590
ADMIN_IDS = 249790928704776560, 149890528604796669
GUILD_IDS
: Comma-separated list of Discord guild (server) IDs where the bot will operate.ADMIN_IDS
: Comma-separated list of Discord user IDs who will have administrative access to the bot.
To deploy the bot, ensure you have set up the environment variables and configured the appropriate environment
files (config/.env.prod
or config/.env.beta
). Then, follow these steps:
- Install dependencies:
pip install -r requirements.txt
- Run the project:
python main.py
Once the bot is running and connected to Discord, you can interact with it using various commands. These commands can be customized based on your bot's functionality. Users with administrative access can manage the bot's settings and commands.
If you'd like to contribute to the bot's development, feel free to fork this repository, make your changes, and submit a pull request. Please ensure your code follows the project's coding standards and includes appropriate documentation for any new features or changes.
This project is licensed under the MIT License.