gitmyhub

go-cqhttp

Go ★ 11k updated 1d ago

cqhttp的golang实现,轻量、原生跨平台.

A Go-based QQ bot framework implementing the OneBot standard that once let developers build bots for the Chinese messaging platform QQ, the project is abandoned and no longer works due to Tencent protocol changes.

GoWebSocketHTTPsetup: hardcomplexity 3/5

Go-cqhttp is a bot framework for QQ, the large Chinese messaging platform operated by Tencent. It lets developers write automated bots that can send and receive messages in QQ private chats and group chats, respond to events like people joining a group, manage group settings, and handle friend requests, all through a programming interface rather than the QQ app itself.

The project implements a standard called OneBot, which is a shared specification for QQ bot APIs. Because go-cqhttp follows that standard, bot code written for other OneBot-compatible tools can generally work with go-cqhttp without being rewritten. The interface supports HTTP, WebSocket in both directions, and webhook-style event posting, so bots can be built in almost any programming language.

Beyond the base OneBot standard, go-cqhttp added a number of extensions: sending image messages, voice and video messages, red envelope handling, forwarding merged conversations, text-to-speech conversion, and proxy-fetched images. Bots can also modify group names, recall messages, and connect to multiple reporting endpoints at once.

Important note from the README: the project has been abandoned and is no longer maintained. Tencent progressively blocked the reverse-engineered QQ protocol this project relied on by updating encryption and authentication schemes. The authors state they can no longer keep up, and they recommend developers move to newer approaches based on the official NTQQ client. The project's issue tracker links to migration guidance.

Go-cqhttp was written in Go, which made it lightweight and easy to compile as a single binary that runs on Windows, macOS, and Linux without extra dependencies. It was widely used in the Chinese developer community for several years before the underlying protocol access was closed off.

Where it fits