Loading repository data…
Loading repository data…
zhiro-labs / repository
⚠️ Moved: This project is now maintained at Dango. Discord AI Agent optimized for Google Gemini • Markdown table rendering • Discord AI Bot • Built on PocketFlow
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
⚠️ Moved: This project is now maintained at Dango.
Daia (Discord AI Agent) is an intelligent Discord bot optimized for Google Gemini and built on the PocketFlow framework. It provides conversational AI capabilities with advanced features like markdown table rendering, message history processing, and Google Search integration.
/newchat command for starting fresh conversation sessions.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.
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:
cp .env.example .env
cp config/chat_sys_prompt.txt.example config/chat_sys_prompt.txt
cp config/runtime.yml.example config/runtime.yml
.env file to add your Discord bot token and Gemini API key.config/chat_sys_prompt.txt to customize the bot's personality and instructions.config/runtime.yml to configure runtime settings and behavior.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.
For the bot to function correctly, you need to configure its permissions and intents in the Discord Developer Portal.
Navigate to your bot's settings in the Discord Developer Portal and enable the following privileged gateway intents:
When inviting the bot to your server, ensure it has the following permissions:
Daia uses two configuration files:
.env)These are set in a .env file in the project root:
DISCORD_BOT_TOKEN: Your Discord bot token. (Required)CHAT_MODEL_API_KEY: Your Google Gemini API key. (Required)CHAT_MODEL: The Gemini model to use (e.g., "gemini-1.5-flash", "gemini-1.5-pro"). (Required)CHAT_TEMPERATURE: Controls the randomness of Gemini's responses (range: 0.0–2.0). (Required)CHAT_SYS_PROMPT_PATH: The path to the system prompt file. (Required)ENABLE_CONTEXTUAL_SYSTEM_PROMPT: Set to on to enable the contextual system prompt, which allows the bot to recognize and address users by their display name. The recommended setting is on (as set in .env.example). If the variable is not set, it defaults to off.CHAT_MODEL_PROVIDER: The LLM provider to use. Currently supports gemini. Defaults to gemini.config/runtime.yml)These settings can be modified at runtime and are stored in config/runtime.yml. Most can also be configured via slash commands (requires administrator permissions):
allowed_channels: A list of channel IDs where the bot is allowed to respond without being mentioned. If empty, the bot will only respond to direct messages and mentions. Use /addchannel, /removechannel, /listchannels to manage.allowed_users: A list of user IDs allowed to DM the bot. Use /adduser, /removeuser, /listusers to manage.timezone: The timezone for bot operations (e.g., "America/New_York", "Europe/London", "Asia/Tokyo"). Defaults to "UTC". Use /settimezone to change.discord_activity: The activity status displayed for the bot (e.g., "Surfing", "Listening to music"). Use /setactivity to change.history_limit: The maximum number of messages to fetch from the channel history. Defaults to 12. Use /sethistorylimit to change.Daia is designed for easy interaction. Here's how you can use its features:
Start a Conversation: To begin interacting with Daia, you have several options:
ALLOWED_CHANNELS is configured with specific channel IDs, you can directly send messages in those channels without mentioning the bot.@Daia hello!) to start a conversation.Continue the Conversation: Daia remembers the recent conversation history. You can simply send a new message to continue the conversation without needing to mention the bot again.
Start a New Chat Session: To start a fresh conversation and clear the context, use the /newchat slash command. This will make the bot forget the previous conversation history in that channel.
Channel Management (Administrator only): Control which channels the bot can respond to without being mentioned:
/addchannel: Add the current channel to the bot's allowed list. The bot will respond to all messages in this channel./removechannel: Remove the current channel from the bot's allowed list. The bot will only respond when mentioned./listchannels: View all channels currently in the allowed list.User Management (Administrator only): Control which users can DM the bot:
/adduser <user>: Add a user to the bot's allowed DM list. The bot will respond to DMs from this user./removeuser <user>: Remove a user from the bot's allowed DM list. The bot will no longer respond to DMs from this user./listusers: View all users currently in the allowed DM list.Configuration Management (Administrator only):
/refreshmetadata: Refresh all channel and user names in the configuration file. Useful when channels or users have been renamed./sethistorylimit <limit>: Set the number of messages to include in conversation history. This controls how much context the bot remembers from previous messages./settimezone <timezone>: Set the bot's timezone for timestamps. Supports IANA timezone names (e.g., "America/New_York", "Europe/London", "Asia/Tokyo"). Features autocomplete to help you find the right timezone.The dev branch contains the latest development progress. To start developing:
# Clone the repository and switch to dev branch
git checkout dev
# Install all dependencies including dev tools
uv sync --dev
This installs both production dependencies and development tools like pytest, ruff, and pre-commit.
This project includes a Makefile with convenient shortcuts for common development tasks:
make help # Show all available commands
make install # Install dependencies with uv (includes --dev flag)
make test # Run tests with pytest
make lint # Check code quality with ruff
make format # Auto-format code with ruff
make format-check # Check if code is properly formatted
make clean # Remove Python cache files
make ci # Run all CI checks locally (lint + format-check + test)
make all # Complete workflow (install + lint + format + test)
Before making changes:
make install # Ensure all dependencies are up to date
During development:
make format # Auto-format your code
make lint # Check for code quality issues
make test # Run the test suite
Before committing:
make ci # Run all checks (same as GitHub Actions)
The make ci command runs the same checks as your GitHub Actions CI, allowing you to catch issues locally before pushing. This saves time by avoiding failed CI runs.
If your CI fails or you encounter linting issues:
Check what's wrong locally:
make lint # See specific linting errors
make format-check # Check formatting issues
Fix automatically:
make format # Auto-fix most formatting issues
Verify the fix:
make ci # Ensure all checks pass before pushing
.
├── .env.example
├── .gitignore
├── main.py
├── pyproje
/setactivity <activity>: Set the bot's Discord activity status message (e.g., "Surfing", "Listening to music").Automatic Table Rendering: When Daia's response contains a markdown table, it will automatically be rendered as an image for better readability. This feature works automatically without any specific commands.
Google Search: If you ask a question that requires up-to-date information, Daia will automatically use its Google Search tool to find the answer.
Long Message Handling: Daia automatically splits long messages into multiple smaller ones, preserving the original formatting. This is an automatic feature to work around Discord's character limit.