yincongcyincong/MuseBot
À propos
Agent pour Telegram, Discord, Slack, Lark (Feishu), DingTalk, WeCom, QQ et WeChat
IA et apprentissage automatiqueWhat you can do
- 🤖 AI Responses: Uses LLM API for chatbot replies.
- ⏳ Streaming Output: Sends responses in real-time to improve user experience.
- 🧠 Long-term Memory: remembers user facts across conversations and injects them into context; accumulated history auto-compresses when it grows too long, see advanced config.
- 💬 Chat Experience: typing indicator while the LLM generates and message reactions on completion (supported platforms).
Progression mesurée des étoiles
- in 24h
- +2
- in 7 days
- +10
- in 15 days
- +25
- in 1 month
- +54
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalMuseBot
This repository provides a Chat bot (Telegram, Discord, Slack, Lark(飞书),钉钉, 企业微信, QQ, 微信) that integrates
with LLM API to provide
AI-powered responses. The bot supports openai deepseek gemini LLMs, making interactions feel
more natural and dynamic.
中文文档
Китайская документация
Thanks
感谢阮一峰老师的weekly,很荣幸能登榜:https://github.com/ruanyf/weekly
感谢linux.do 社区,佬友们很给力,给一个我的介绍贴链接:https://linux.do/t/topic/1128110
Thanks to the Reddit community as well, even though a few of my subreddits got banned 😅: https://www.reddit.com/
🚀 Features
- 🤖 AI Responses: Uses LLM API for chatbot replies.
- ⏳ Streaming Output: Sends responses in real-time to improve user experience.
- 🧠 Long-term Memory: remembers user facts across conversations and injects them into context; accumulated history auto-compresses when it grows too long, see advanced config.
- 💬 Chat Experience: typing indicator while the LLM generates and message reactions on completion (supported platforms).
- 🏗 Easy Deployment: Run locally or deploy to a cloud server.
- 👀 Identify Image: use image to communicate with LLM, see doc.
- 📄 Identify Document: send txt/pdf/csv/html documents and ask questions; chat media is stored locally per conversation, see doc.
- 🎺 Support Voice: use voice to communicate with LLM, see doc.
- 🐂 Function Call: transform mcp protocol to function call, see doc.
- 🧩 Skills: load local
SKILL.mdinstructions into the unified/taskworkflow, see doc. - 🛠️ Conversational System Operations: inside the
/taskworkflow, manage runtime settings, MCP, skills, and cron jobs, and run commands and file operations inside safety boundaries, see doc. - 🌊 RAG: Support Rag to fill context, see doc.
- 🌞 AdminPlatform: Use platform to manage MuseBot, see doc.
- 🌛 Register: With the service registration module, robot instances can be automatically registered to the registration center doc
- 🧩 Plugins: Wire up new LLM providers and chat channels through the provider / channel registries — one file per extension, see doc
- 🛟 Model-layer resilience: automatically fail over from the primary model to other configured providers, and route internal calls to a cheap utility model, see doc
- 🌈 Metrics: Support Metrics for monitoring, see doc.
- 🐶 Cron: Support Cron to trigger LLM, see doc.
Usage Video
easiest way to use: https://www.youtube.com/watch?v=4UHoKRMfNZg
deepseek: https://www.youtube.com/watch?v=kPtNdLjKVn0
gemini: https://www.youtube.com/watch?v=7mV9RYvdE6I
chatgpt: https://www.youtube.com/watch?v=G_DZYMvd5Ug
📸 Support Platform
| Platform | Supported | Description | Docs / Links |
|---|---|---|---|
| 🟦 Telegram | ✅ | Supports Telegram bot (go-telegram-bot-api based, handles commands, inline buttons, ForceReply, etc.) | Docs |
| 🌈 Discord | ✅ | Supports Discord bot | Docs |
| 🌛 Web API | ✅ | Provides HTTP/Web API for interacting with LLM (great for custom frontends/backends) | Docs |
| 🔷 Slack | ✅ | Supports Slack (Socket Mode / Events API / Block Kit interactions) | Docs |
| 🟣 Lark (Feishu) | ✅ | Supports Lark long connection & message handling (based on larksuite SDK, with image/audio download & message update) | Docs |
| 🆙 DingDing | ✅ | Supports Dingding long connection | Docs |
| ⚡️ Work WeChat | ✅ | Support Work WeChat http callback to trigger LLM | Docs |
| ✅ | Support QQ http callback to trigger LLM | Docs | |
| ✅ | Support Wechat http callback to trigger LLM | Docs |
Supported Large Language Models
NOTE: All providers are accessed through the OpenAI-compatible API format (chat completions, images, audio). Aliyun (Qwen) and Vol (Doubao) are the recommended/fully-supported providers. Third-party relay services (OpenRouter / OrcaRouter / 302.AI) have been removed.
| Model | Provider | Text Generation | Image Generation | Video Generation | Recognize Photo | TTS | Link |
|---|---|---|---|---|---|---|---|
| 🐦 Doubao | ByteDance (vol) | ✅ | ✅ | ✅ | ✅ | ✅ | doc |
| 🐦 Qwen | Aliyun | ✅ | ✅ | ✅ | ✅ | ✅ | doc |
| 🌟 Gemini | ✅ | ✅ | ✅ | ✅ | ✅ | doc | |
| 💬 ChatGPT | OpenAI | ✅ | ✅ | ❌ | ✅ | ✅ | doc |
| 🧠 DeepSeek | DeepSeek | ✅ | ❌ | ❌ | ❌ | ❌ | doc |
| 🌐 ChatAnywhere | ChatAnywhere | ✅ | ✅ | ❌ | ✅ | ❌ | doc |
🤖 Text Example
🎺 Multimodal Example
📥 Installation
Clone the repository
git clone https://github.com/yincongcyincong/MuseBot.git cd MuseBotInstall dependencies
go mod tidySet up environment variables
export TELEGRAM_BOT_TOKEN="your_telegram_bot_token" export DEEPSEEK_TOKEN="your_deepseek_api_key"
🚀 Usage
Run the bot locally:
go run main.go -telegram_bot_token=telegram-bot-token -deepseek_token=deepseek-auth-token
Use docker
docker pull jackyin0822/musebot:latest
chmod 777 /home/user/data
docker run -d -v /home/user/data:/app/data -e TELEGRAM_BOT_TOKEN="telegram-bot-token" -e DEEPSEEK_TOKEN="deepseek-auth-token" -p 36060:36060 -p 18080:18080 --name my-bot jackyin0822/MuseBot:latest
ALIYUN:
docker pull crpi-i1dsvpjijxpgjgbv.cn-hangzhou.personal.cr.aliyuncs.com/jackyin0822/musebot:latest
chmod 777 /home/user/data
docker run -d -v /home/user/data:/app/data -e TELEGRAM_BOT_TOKEN="telegram-bot-token" -e DEEPSEEK_TOKEN="deepseek-auth-token" -p 36060:36060 -p 18080:18080 --name my-bot crpi-i1dsvpjijxpgjgbv.cn-hangzhou.personal.cr.aliyuncs.com/jackyin0822/musebot:latest
command: (doc)[https://github.com/yincongcyincong/MuseBot/blob/main/static/doc/param_conf.md]
⚙️ Configuration
You can configure the bot via environment variables:
Here’s the English version of your environment variable table: If you use parameter. Please use lower letter and underscore. for example: ./MuseBot -telegram_bot_token=xxx
| Variable Name | Description | Default Value |
|---|---|---|
| TELEGRAM_BOT_TOKEN | Telegram bot token | - |
| DISCORD_BOT_TOKEN | Discord bot token | - |
| SLACK_BOT_TOKEN | Slack bot token | - |
| SLACK_APP_TOKEN | Slack app-level token | - |
| LARK_APP_ID | Lark (Feishu) App ID | - |
| LARK_APP_SECRET | Lark (Feishu) App Secret | - |
| DING_CLIENT_ID | DingTalk App Key / Client ID | - |
| DING_CLIENT_SECRET | DingTalk App Secret | - |
| COM_WECHAT_TOKEN | WeCom (Enterprise WeChat) token | - |
| COM_WECHAT_ENCODING_AES_KEY | WeCom EncodingAESKey | - |
| COM_WECHAT_CORP_ID | WeCom CorpID | - |
| COM_WECHAT_SECRET | WeCom App Secret | - |
| COM_WECHAT_AGENT_ID | WeCom Agent ID | - |
| WECHAT_APP_ID | WeChat Official Account AppID | - |
| WECHAT_APP_SECRET | WeChat Official Account AppSecret | - |
| WECHAT_ENCODING_AES_KEY | WeChat Official Account EncodingAESKey | - |
| WECHAT_TOKEN | WeChat Official Account Token | - |
| WECHAT_ACTIVE | Whether to enable WeChat message listening (true/false) | false |
| QQ_APP_ID | QQ Open Platform AppID | - |
| QQ_APP_SECRET | QQ Open Platform AppSecret | - |
| QQ_ONEBOT_RECEIVE_TOKEN | Token for ONEBOT → MuseBot event messages | MuseBot |
| QQ_ONEBOT_SEND_TOKEN | Token for MuseBot → ONEBOT message sending | MuseBot |
| QQ_ONEBOT_HTTP_SERVER | ONEBOT HTTP server address | http://127.0.0.1:3000 |
| DEEPSEEK_TOKEN | DeepSeek API key | - |
| OPENAI_TOKEN | OpenAI API key | - |
| GEMINI_TOKEN | Google Gemini API token | - |
| ALIYUN_TOKEN | Aliyun Bailian token doc | - |
| VOL_TOKEN | Volcano Engine general token doc | - |
| VOLC_AK | Volcano Engine multimedia access key doc | - |
| VOLC_SK | Volcano Engine multimedia secret key doc | - |
| ERNIE_AK | Baidu ERNIE large model AK doc | - |
| ERNIE_SK | Baidu ERNIE large model SK doc | - |
| CUSTOM_URL | Custom LLM API endpoint | https://api.deepseek.com/ |
| OLLAMA_URL | Ollama server url (wins over CUSTOM_URL for the ollama type) | http://localhost:11434/ |
| TYPE | LLM type (deepseek/openai/gemini/vol/chatanywhere/aliyun/ollama), all via OpenAI-compatible format | deepseek |
| MEDIA_TYPE | Media generation source (openai/gemini/vol/aliyun), all via OpenAI-compatible format | vol |
| DB_TYPE | Database type (sqlite3/mysql) | sqlite3 |
| DB_CONF | Database config path or connection string | ./data/muse_bot.db |
| LLM_PROXY | LLM network proxy (e.g. http://127.0.0.1:7890) | - |
| ROBOT_PROXY | Bot network proxy (e.g. http://127.0.0.1:7890) | - |
| LANG | Language (en/zh) | en |
| TOKEN_PER_USER | Max tokens allowed per user, 0 means no limit | 10000 |
| MAX_USER_CHAT | Maximum concurrent chats per user | 2 |
| HTTP_HOST | MuseBot HTTP server port | :36060 |
| USE_TOOLS | Enable function-calling tools (true/false) | false |
| MAX_QA_PAIR | Max number of question-answer pairs to keep as context | 100 |
| CHARACTER | AI personality description | - |
| CRT_FILE | HTTPS certificate file path | - |
| KEY_FILE | HTTPS private key file path | - |
| CA_FILE | HTTPS CA certificate file path | - |
| ADMIN_USER_IDS | Comma-separated list of admin user IDs | - |
| ALLOWED_USER_IDS | Comma-separated user IDs allowed to use the bot; empty = all allowed; 0 = all banned | - |
| ALLOWED_GROUP_IDS | Comma-separated group IDs allowed to use the bot; empty = all allowed; 0 = all banned | - |
| BOT_NAME | Bot name | MuseBot |
| CHAT_ANY_WHERE_TOKEN | ChatAnyWhere platform token | - |
| SMART_MODE | Automatically check what you want to generate (txt/photo/video) and route multi-step tasks to /task |
true |
| SEND_MCP_RES | send mcp result to user | false |
| TASK_AUTO_APPROVE | auto approve task tool operations (commands/config changes) without /y confirmation | false |
| DEFAULT_MODEL | default txt model | - |
| CONFIG | path to a json config file; file values beat command-line flags, env vars beat the file | - |
config file
Instead of long flag/env lists, put your configuration in a json file and point the bot at it with -conf or the CONFIG env var:
go run main.go -conf=conf/examples/telegram_deepseek.json
# docker: mount the config file
docker run -d -v /home/user/data:/app/data \
-v /home/user/mybot.json:/app/mybot.json \
-e CONFIG="/app/mybot.json" \
-p 36060:36060 -p 18080:18080 --name my-bot jackyin0822/musebot:latest
Two formats are supported:
Flat (recommended — top-level keys use the lowercased-underscore form of the env names):
{
"telegram_bot_token": "your-telegram-bot-token",
"type": "deepseek",
"deepseek_token": "your-deepseek-api-key",
"smart_mode": true,
"admin_user_ids": {"123456789": true}
}
Sectioned (same layout as the config persisted by the admin panel: base/llm/audio/photo/video/rag/tools/register sections for fine-grained control):
{
"base": {
"telegram_bot_token": "your-telegram-bot-token",
"type": "deepseek",
"deepseek_token": "your-deepseek-api-key"
},
"llm": {
"temperature": 0.7
}
}
Precedence: env vars > config file > command-line flags > defaults. Keys missing from the file keep their defaults; restart to apply changes.
conf/examples/ ships a few classic configs ready to copy and edit:
| File | Scenario |
|---|---|
telegram_deepseek.json |
Telegram + DeepSeek, simplest setup |
telegram_glm_thirdparty.json |
Telegram + Zhipu GLM (third-party OpenAI-compatible), smart_mode + task auto-approval on |
discord_openai.json |
Discord + OpenAI, function call + streaming on |
lark_aliyun.json |
Lark + Aliyun Bailian |
dingtalk_deepseek.json |
DingTalk + DeepSeek, smart_mode on |
full_nested.json |
Full sectioned example (base + llm + tools) |
CUSTOM_URL
If you are using a self-deployed llm, you can set CUSTOM_URL to route requests to your self-deployed llm.
DB_TYPE
support sqlite3 or mysql
DB_CONF
if DB_TYPE is sqlite3, give a file path, such as ./data/telegram_bot.db
if DB_TYPE is mysql, give a mysql link, such as
root:admin@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local, database must be created.
LANG
choose a language for bot, English (en), Chinese (zh), Russian (ru).
other config
llm_conf
photo_conf
video_conf
audio_conf
advanced_conf (third-party models / smart_mode / task auto-approval)
Command
/clear $clear
clear all of your communication record with deepseek. this record use for helping deepseek to understand the context.
/retry $retry
retry last question.
/txt_type /photo_type /video_type /rec_type $txt_type $photo_type $video_type $rec_type
choose txt/photo/video/recognize model type.
/txt_model /img_model /video_model /rec_model $txt_model $img_model $video_model $rec_model
choose txt/photo/video/recognize model.
/mode $mode
show current model type and model.
/state $state
calculate one user token usage.
/photo /edit_photo $photo $edit_photo
/edit_photo will update you photo base on your description.
/video $video
/chat $chat
allows the bot to chat through /chat command in groups,
without the bot being set as admin of the group.
/help $help
/task $task
multi agent communicate with each other!
Deployment
Deploy with Docker
The image runs two processes under supervisord: the main MuseBot service and the MuseBotAdmin management platform. Both restart automatically if they crash.
Build the Docker image
docker build -t musebot .Run the container
docker run -d -v /home/user/xxx/data:/app/data \ -e TELEGRAM_BOT_TOKEN="telegram-bot-token" \ -e DEEPSEEK_TOKEN="deepseek-auth-token" \ -p 36060:36060 -p 18080:18080 \ --name my-bot musebotPorts and volumes
/app/data: persist this volume — sqlite database, admin database (muse_bot_admin.db), media files and the auto-generated admin session key.36060: main service HTTP (webhook callbacks, config API, SSE chat).18080: admin web UI.ffmpeg/ffprobe,nodejs/npmandlibopusare pre-installed for voice, video and skill features.
First admin login The default account
admin/adminis created on first start. After login the admin UI shows a change-password prompt (you can click "Later" to skip, but changing it soon is recommended). Log in athttp://<host>:18080(see the admin doc).
Task web search
The built-in web_search task agent uses DuckDuckGo with Bing fallback by default.
To use Parallel Search MCP
instead, set WEB_SEARCH_PROVIDER=parallel before starting MuseBot, or pass
-web_search_provider=parallel on a fresh installation. The setting is also saved
as tools.web_search_provider in the bot configuration. Environment values
override the saved setting.
Parallel searches use Fast mode at https://search.parallel.ai/mcp, without an
account or API key. The task agent receives titles, source URLs and relevant
excerpts in the existing search result format. This provider supports search;
it does not add a page-fetch tool. Anonymous usage is subject to service limits,
and errors are returned to the task without switching providers.
To use Outcrawl instead, set WEB_SEARCH_PROVIDER=outcrawl
(or -web_search_provider=outcrawl) and put your key in OUTCRAWL_API_KEY. The
task agent receives titles, source URLs and snippets in the same result format.
Outcrawl needs an API key (there is a free tier of 1,000 credits a month). A
missing key or an API error is returned to the task without switching providers.
To use the SpecStream Search API instead, set
WEB_SEARCH_PROVIDER=specstream (or -web_search_provider=specstream) and put your
key in SPECSTREAM_API_KEY. The task agent receives titles, source URLs and snippets
in the same result format. A missing key or an API error is returned to the task
without switching providers.
To use Keenable instead, set
WEB_SEARCH_PROVIDER=keenable (or -web_search_provider=keenable). It works
without an account or API key: keyless requests go to the public endpoint, which
Keenable rate limits per IP address. Set KEENABLE_API_KEY to use the keyed
endpoint instead. The task agent receives titles, source URLs and snippets in the
same result format. Search queries are sent to Keenable; keyless requests are
logged with the query, IP address and user agent
(details). Errors
are returned to the task without switching providers.
To use Sofya instead, set WEB_SEARCH_PROVIDER=sofya
(or -web_search_provider=sofya) and put your key in SOFYA_API_KEY. The task
agent receives titles, source URLs and snippets in the same result format. Sofya
is pay as you go and does not charge for a failed request. A missing key or an
API error is returned to the task without switching providers.
Use default to retain DuckDuckGo/Bing, or disabled to block built-in web
search. Custom MCP servers and their tool settings are separate. Each /task
or /mcp research run has its own opaque Parallel session identifier, reused by
its agents and subsequent searches within that run.
Contributing
Feel free to submit issues and pull requests to improve this bot. 🚀
group
telegram-group: https://t.me/+WtaMcDpaMOlhZTE1
QQ群:1031411708
License
MIT License © 2025 jack yin
Explorer des projets similaires
Chargement…