shuiping233 866e546b59 feat: integrates KOOK platform adapter (#5658)
* feat: 将kook适配器插件并入astrbot官方适配器目录中

* refactor: 重命名函数名为 _warp_message

* refactor: 使用Protocol替换Union类型

* bugfix: 修复base64前缀处理问题

* refactor: 抛出的错误不再包含"[kook]"

* refactor: 添加读取本地文件时的路径安全检查

* refactor: 卡片消息解析失败时会打印错误信息

* refactor: 添加处理接收卡片消息内的图片url时的安全校验

* refactor: 安全处理ws需要重连的情况

* Revert "refactor: 使用Protocol替换Union类型"

This reverts commit 58e0dceeb20c3d7dddb16f623fd3bbdcfa632173.

* feat: 添加获取机器人名称的实现

* refactor: 让send_by_session发送主动消息时正确传入当前消息链的文本消息内容

* refactor: 统一处理适配器配置相关内容,处理仪表盘出传入配置,并添加仪表盘的kook适配器配置页面的i18n文本

* unittest: 添加kook适配器的单元测试,虽然没覆盖多少单测

* unittest: TEST_DATA_DIR用更安全的路径

* refactor: KookConfig使用了更好的默认值处理方式

* refactor: 移除kook_adapter 的config字段重复定义

* refactor: 隐藏获取kook gateway时url里的token,防止把token打印出来

* refactor: KookConfig.pretty_jsons使用*来屏蔽token内容

* bugfix: 修复主动发送消息时,调用了父方法`send_by_session`可能导致指标被重复上传的bug

* refactor: 优化upload_asset的路径处理报错

* bugfix: 修复kook ws心跳间隔可能会出现负数时间的bug

* refactor: KookClient移到KookPlatformAdapter.__init__里初始化

* bugfix: 修复处理base64 url 多替换了/而报错的bug

* refactor: kook适配器上传文件失败时,会抛出错误

* chore: 移除一条注释

* refactor: 移除没用的return

* refactor: 即使消息链中有消息发送失败了,也尽可能将其他消息发送出去,并把报错信息也发送出去

* refactor: 增强上传任务失败时的错误处理,使其发生错误时尽力而为发送其余消息

* refactor: 发送到消息频道的报错消息加了个⚠️,小巧思这块?

* refactor: 咱们在写适配器啊,要什么小巧思呢,小巧思给上游插件开发弄不好么)

* refactor: enhance Kook adapter with kmarkdown parsing and improve file URL handling

* refactor: extract card message parsing logic into a separate method

* feat: add kook_bot_nickname configuration to ignore messages from specific nicknames

* refactor: remove commented-out code and clean up file upload error handling

* fix: remove redundant prefix handling for file URLs in asset upload

---------

Co-authored-by: Soulter <905617992@qq.com>
2026-03-03 15:08:16 +08:00
2026-02-26 19:12:09 +08:00
2023-04-15 15:33:00 +08:00
2026-01-13 12:19:05 +08:00
2025-02-24 00:31:57 +08:00
2026-02-21 17:20:26 +08:00
2026-02-28 21:23:44 +08:00
2026-02-28 21:23:44 +08:00
2026-02-28 21:23:44 +08:00
2026-02-28 21:23:44 +08:00
2026-02-28 21:23:44 +08:00

AstrBot-Logo-Simplified

AstrBot is an open-source all-in-one Agent chatbot platform that integrates with mainstream instant messaging apps. It provides reliable and scalable conversational AI infrastructure for individuals, developers, and teams. Whether you're building a personal AI companion, intelligent customer service, automation assistant, or enterprise knowledge base, AstrBot enables you to quickly build production-ready AI applications within your IM platform workflows.

screenshot_1 5x_postspark_2026-02-27_22-37-45

Key Features

  1. 💯 Free & Open Source.
  2. AI LLM Conversations, Multimodal, Agent, MCP, Skills, Knowledge Base, Persona Settings, Auto Context Compression.
  3. 🤖 Supports integration with Dify, Alibaba Cloud Bailian, Coze, and other agent platforms.
  4. 🌐 Multi-Platform: QQ, WeChat Work, Feishu, DingTalk, WeChat Official Accounts, Telegram, Slack, and more.
  5. 📦 Plugin Extensions with 1000+ plugins available for one-click installation.
  6. 🛡️ Agent Sandbox for isolated, safe execution of code, shell calls, and session-level resource reuse.
  7. 💻 WebUI Support.
  8. 🌈 Web ChatUI Support with built-in agent sandbox and web search.
  9. 🌐 Internationalization (i18n) Support.

💙 Role-playing & Emotional Companionship Proactive Agent 🚀 General Agentic Capabilities 🧩 1000+ Community Plugins

99b587c5d35eea09d84f33e6cf6cfd4f

c449acd838c41d0915cc08a3824025b1

image

image

Quick Start

One-Click Deployment

For users who want to quickly experience AstrBot, we recommend using the one-click deployment method with uv :

uv tool install astrbot
astrbot init # Only execute this command for the first time to initialize the environment
astrbot

Requires uv to be installed.

Docker Deployment

For users who want a more stable and production-ready deployment, we recommend using Docker / Docker Compose to deploy AstrBot.

Please refer to the official documentation: Deploy AstrBot with Docker.

Deploy on RainYun

For users who want to deploy AstrBot with one-click and don't want to manage the server, we recommend using RainYun's one-click cloud deployment service ☁️:

Deploy on RainYun

Desktop Application (Tauri)

For users who want to deploy AstrBot on their desktop, primarily using AstrBot ChatUI, rarely use AstrBot plugins, we recommend using the AstrBot App:

Desktop repository: AstrBot-desktop.

Supports multiple system architectures, direct package installation, and out-of-the-box usage. A convenient one-click desktop deployment option for beginners.

One-Click Launcher Deployment (AstrBot Launcher)

For users who want a quick deployment and multi-instance solution with environment isolation, we recommend using the AstrBot Launcher:

Visit the AstrBot Launcher repository and install the package for your OS from the latest release.

A quick deployment and multi-instance solution with environment isolation.

Deploy on Replit

Community-contributed deployment method.

Run on Repl.it

AUR

yay -S astrbot-git

More deployment methods: BT-Panel Deployment | 1Panel Deployment | CasaOS Deployment | Manual Deployment

Supported Messaging Platforms

Connect AstrBot to your favorite chat platform.

Platform Maintainer
QQ Official
OneBot v11 protocol implementation Official
Telegram Official
Wecom & Wecom AI Bot Official
WeChat Official Accounts Official
Feishu (Lark) Official
DingTalk Official
Slack Official
Discord Official
LINE Official
Satori Official
Misskey Official
WhatsApp (Coming Soon) Official
Matrix Community
KOOK Community
VoceChat Community

Supported Model Services

Service Type
OpenAI and Compatible Services LLM Services
Anthropic LLM Services
Google Gemini LLM Services
Moonshot AI LLM Services
Zhipu AI LLM Services
DeepSeek LLM Services
Ollama (Self-hosted) LLM Services
LM Studio (Self-hosted) LLM Services
AIHubMix LLM Services (API Gateway, supports all models)
CompShare LLM Services
302.AI LLM Services
TokenPony LLM Services
SiliconFlow LLM Services
PPIO Cloud LLM Services
ModelScope LLM Services
OneAPI LLM Services
Dify LLMOps Platforms
Alibaba Cloud Bailian Applications LLMOps Platforms
Coze LLMOps Platforms
OpenAI Whisper Speech-to-Text Services
SenseVoice Speech-to-Text Services
OpenAI TTS Text-to-Speech Services
Gemini TTS Text-to-Speech Services
GPT-Sovits-Inference Text-to-Speech Services
GPT-Sovits Text-to-Speech Services
FishAudio Text-to-Speech Services
Edge TTS Text-to-Speech Services
Alibaba Cloud Bailian TTS Text-to-Speech Services
Azure TTS Text-to-Speech Services
Minimax TTS Text-to-Speech Services
Volcano Engine TTS Text-to-Speech Services

❤️ Contributing

Issues and Pull Requests are always welcome! Feel free to submit your changes to this project :)

How to Contribute

You can contribute by reviewing issues or helping with pull request reviews. Any issues or PRs are welcome to encourage community participation. Of course, these are just suggestions—you can contribute in any way you like. For adding new features, please discuss through an Issue first.

Development Environment

AstrBot uses ruff for code formatting and linting.

git clone https://github.com/AstrBotDevs/AstrBot
pip install pre-commit
pre-commit install

🌍 Community

QQ Groups

  • Group 1: 322154837
  • Group 3: 630166526
  • Group 5: 822130018
  • Group 6: 753075035
  • Group 7: 743746109
  • Group 8: 1030353265
  • Developer Group: 975206796

Discord Server

Discord_community

❤️ Special Thanks

Special thanks to all Contributors and plugin developers for their contributions to AstrBot ❤️

Additionally, the birth of this project would not have been possible without the help of the following open-source projects:

Star History

Tip

If this project has helped you in your life or work, or if you're interested in its future development, please give the project a Star. It's the driving force behind maintaining this open-source project <3

Star History Chart

Companionship and capability should never be at odds. What we aim to create is a robot that can understand emotions, provide genuine companionship, and reliably accomplish tasks.

私は、高性能ですから!

S
Description
No description provided
Readme AGPL-3.0 65 MiB
Languages
Python 69.1%
Vue 25.4%
TypeScript 3.4%
JavaScript 1.4%
Shell 0.3%
Other 0.4%