Getting Started
Prerequisites
- A Discord Bot Token. You can follow the official guide to create one: Discord Developer Documentation.
- A Google Gemini API Key. You can obtain one from Google AI Studio.
Environment
This project requires Python 3.12+. uv will gracefully handle the Python version requirement, create a virtual environment, and manage all project dependencies for you.
Installation
-
Clone the repository:
git clone https://github.com/zhiro-labs/daia.git cd daia -
Install dependencies:
uv syncℹ️ Note: If you don’t have
uvinstalled, you can follow the official installation guide: https://docs.astral.sh/uv/getting-started/installation/ -
Configure your environment and system prompt:
- Copy the example files to create your own configuration:
cp .env.example .env cp config/chat_sys_prompt.txt.example config/chat_sys_prompt.txt cp config/runtime.yml.example config/runtime.yml - Edit the
.envfile to add your Discord bot token and Gemini API key. - Edit
config/chat_sys_prompt.txtto customize the bot’s personality and instructions. - Edit
config/runtime.ymlto configure runtime settings and behavior.
- Copy the example files to create your own configuration:
-
Run the bot:
uv run main.pyℹ️ Note: On first run, the bot will automatically download Noto CJK fonts (~100MB) for high-quality table image rendering. This may take a few minutes depending on your internet connection.
Discord Application Permissions and Intents
For the bot to function correctly, you need to configure its permissions and intents in the Discord Developer Portal.
Privileged Gateway Intents
Navigate to your bot’s settings in the Discord Developer Portal and enable the following privileged gateway intents:
- Server Members Intent: Required for the bot to recognize and address users by their display name.
- Message Content Intent: Required for the bot to read message content.
Bot Permissions
When inviting the bot to your server, ensure it has the following permissions:
- General Permissions
- View Channels
- Text Permissions
- Send Messages
- Attach Files
- Read Message History