
A Discord bot, powered by Gemini.
- Uses judgement on when to engage with server members, taking channel context into consideration.
- Views and discusses media posted in chat.
- Supports reading JPEGs, PNGs, and most websites.
- Experimental support for MP4s, GIFs, WAVs and MP3 files.
- Generates photos, movies, songs and essays as requested.
- Translates technical errors into user-friendly language, when appropriate.
Note
Interested in contributing? See our Contribution Guide!
- Homebrew (https://brew.sh/)
- GCP Project (https://developers.google.com/workspace/guides/create-project)
- Discord Application (https://discord.com/developers/applications)
- Copy
.env.example
to.env.development
:
cp .env.example .env.development
- Get your GCP information and add it to
.env.development
. - Get your Discord information and add it to
.env.development
. - Set up the environment with
deno task setup
. - Start Bott with
deno task start:dev
.
Bott is configured via a series of environment variables.
Name | Description | Default |
---|---|---|
CONFIG_ASSESSMENT_MODEL |
The AI model used for quality assessment of potential bot responses. | gemini-2.5-flash-lite |
CONFIG_ASSESSMENT_SCORE_THRESHOLD |
The minimum score (1-100) a potential response must achieve in quality assessments (e.g., novelty, relevance) to be sent. | 70 |
CONFIG_ERROR_MODEL |
The AI model used for generating user-friendly error messages. | gemini-2.5-flash |
CONFIG_ESSAY_MODEL |
The AI model used for generating essays and long-form text content. | gemini-2.5-pro |
CONFIG_EVENTS_MODEL |
The AI model used for generating responses to chat events and user messages. | gemini-2.5-flash |
CONFIG_INPUT_EVENT_LIMIT |
The maximum number of past chat events to include in the context for the AI model. | 2000 |
CONFIG_INPUT_FILE_TOKEN_LIMIT |
The maximum number of tokens to use for analyzing the content of input files (images, websites). | 500000 |
CONFIG_MOVIE_MODEL |
The AI model used for generating video content. | veo-3.0-generate-preview |
CONFIG_PHOTO_MODEL |
The AI model used for generating images. | imagen-4.0-generate-preview-06-06 |
CONFIG_RATE_LIMIT_IMAGES |
The maximum number of images Bott can generate per month. | 100 |
CONFIG_RATE_LIMIT_MUSIC |
The maximum number of songs Bott can generate per month. | 25 |
CONFIG_RATE_LIMIT_VIDEOS |
The maximum number of videos Bott can generate per month. | 10 |
CONFIG_SONG_MODEL |
The AI model used for generating music and audio content. | lyria-002 |
DISCORD_TOKEN |
The authentication token for your Discord bot application. | - |
FILE_SYSTEM_ROOT |
The root directory on the local file system for storing input and output files. | ./fs_root |
GOOGLE_ACCESS_TOKEN |
An access token for authenticating with Google Cloud APIs (for local development). | - |
GOOGLE_PROJECT_ID |
The ID of your Google Cloud project. | - |
GOOGLE_PROJECT_LOCATION |
The GCP region where your Vertex AI resources are located. | - |
LOG_TOPICS |
Controls which log topics to display. Comma-separated list of topics: debug, info, warn, error, perf. | info,warn,error |
PORT |
The port of the health check server required for GCP Cloud Run. | 8080 |
(TODO: need to enable the correct APIs)
Deploying Bott to Google Cloud Run involves two main steps: deploying the service itself, then configuring the necessary permissions.
Click this button to deploy the Bott service:
- Navigate to the IAM & Admin page in your Google Cloud project.
- Find the service account that was created for your new Cloud Run service.
- Click the pencil icon to edit its permissions.
- Click + ADD ANOTHER ROLE and add the following two roles:
Vertex AI User
(allows the bot to access Gemini models)Storage Object Admin
(allows the bot to read/write temporary files)
- Click SAVE.
Bott should now be running correctly. You may need to trigger a new revision deployment from the Cloud Run console for the permission changes to take effect immediately.
Tip
Review the code data model annotated in ./model/types.ts.
graph TD
subgraph "@bott/model"
BottDiscord["**@bott/discord**"]
subgraph App["./app"]
BottAppLayer["**@bott/task**"]
BottDataLayer["**@bott/storage**<br>Persistence layer"]
BottAppLayer --> BottDataLayer
BottDataLayer --> BottAppLayer
end
BottGemini["**@bott/gemini**"]
end
%% Flow from Discord User to Bot and back
Discord -- "User Message" --> BottDiscord
BottDiscord -- "BottEvent" --> App
App -- "BottEvent" --> BottGemini
BottGemini -- "Calls Gemini API" --> Gemini
Gemini -- "Generated Data" --> BottGemini
BottGemini -- "BottEvent" --> App
App -- "BottEvent" --> BottDiscord
BottDiscord -- "System Message" --> Discord
style App fill:darkblue;
This project is dual-licensed. This model allows for free, open-source use for non-commercial purposes while requiring a separate license for commercial applications.
-
For Non-Commercial Use: This software is free and open-source under the terms of the GNU Affero General Public License v3.0 (AGPLv3).
- Read the full AGPLv3 license details in the LICENSE file.
-
For Commercial Use: Use of this software for any purpose that is intended for commercial advantage or monetary compensation requires a Proprietary Commercial License. Please contact [email protected] to discuss licensing terms.
Copyright (C) 2025 DanielLaCos.se