dsh-qqbot-send: Proactively Enable DSH Agent to Send Messages to QQ

Preface

In DSH, integrating QQ usually involves installing the dsh-qqbot gateway: when a user sends a message from QQ, the agent replies within the conversation. If the session originates from another channel (local CLI, Web, another IM), or when a task finishes and you need to “push a result to QQ,” inbound conversations alone are often insufficient—you need an outbound capability that directly calls the QQ Open Platform REST API without depending on the current inbound message.

dsh-qqbot-send (maintainer: xuan25, community category: Networking tools) is an out-of-tree plugin designed for such needs: it registers callable tools for a DSH agent, enabling a single tool call to push text or Markdown to QQ private chats, groups, channels, or guild DMs; it can coexist with a running dsh-qqbot gateway via pure REST without sharing connections.

What is this

In one sentence: dsh-qqbot-send provides DSH profiles with two tools via the QQ Open Platform REST API: proactively sending messages and resolving the QQ target of the current session, so any session can reach users on QQ even if the conversation started elsewhere.

Repository: github.com/xuan25/dsh-qqbot-send
Catalog page: skillhub.cn/plugins/xuan25/dsh-qqbot-send
License: MIT (see the repository’s package.json); current version 0.1.0. The community catalog shows 0 stars; it is not officially affiliated with DeepSeek/Hunyuan and is merely an independent plugin site entry.

Core features

Proactively send to any QQ target

The tool qqbot_send_message can send content without an inbound message:

  • target formats: c2c:<openid> (private chat), group:<group_openid> (group), channel:<channel_id> (channel), dm:<guild_id> (guild DM)
  • content: body (Markdown or plain text)
  • markdown (optional): for c2c/group, defaults follow the config item markdownSupport; for channels/DMs, plain text by default

Long bodies are automatically split into chunks at line boundaries; fenced code blocks and table rows are moved intact to the next chunk, and after concatenation they match the original. If any chunk fails, subsequent sends stop; the platform-returned bizCode (if present) is written to the result’s note field.

Resolve the QQ conversation of the current session

The tool qqbot_current_target resolves the QQ conversation corresponding to the current agent session without side effects. If the dsh-qqbot gateway is installed and running and the session was recorded by it, it returns a target string that can be used directly with qqbot_send_message (e.g., group:<group_openid>); if the gateway is not installed or the session cannot be found, it returns a brief explanation.

Coexist with the gateway

The plugin does not occupy the dsh-qqbot long connection; it only sends messages and looks up targets via REST, suitable for the “gateway receives messages + this plugin proactively pushes” combination.

Installation and enabling

Run the official install command under the target DSH profile (do not manually assemble github:owner/repo):

dsh plugin --profile <name> add dsh-qqbot-send

The plugin registers automatically. To view the merged configuration:

dsh --profile <name> --dump-config

Then start or restart the profile.

Dependencies: the host must provide the dsh-tools service; without it the plugin remains inactive. Node.js >= 18; peer dependencies include @deepseek-ai/cordis, @deepseek-ai/dsh-tools, @deepseek-ai/schemastery (versions see the repository’s package.json).

Configuration

If the profile environment already provides QQBOT_APPID and QQBOT_SECRET, no additional configuration is required. You can also fill in or override defaults directly in the plugin configuration:

Key Default Description
appId env QQBOT_APPID bot application id
appSecret env QQBOT_SECRET bot application secret
markdownSupport true whether c2c/group default to Markdown
chunkLimit 4500 maximum characters per message
chunkGapMs 500 interval between chunk sends (milliseconds)

The default base URLs for message and token APIs are https://api.bot.qq.com, which can be overridden by the environment variables QQBOT_BASE_URL and QQBOT_TOKEN_BASE_URL. The keys in the table above can also reference __FROM_ENV__ or process.env.VARNAME.

Missing credentials do not prevent registration: both tools will register, and actual sends will error at execution time. Before installing, it is still recommended to read the source code and the MIT license; the plugin runs with the current dsh process permissions.

Typical usage

  1. Configure or export QQBOT_APPID, QQBOT_SECRET (and optionally base URL environment variables).
  2. Install the plugin and use --dump-config to confirm the entries are merged, then restart the profile.
  3. Call the tools on the agent side:
    - If you already know the openid / group openid etc.: pass the corresponding target and content to qqbot_send_message.
    - If the session came from the QQ gateway: first call qqbot_current_target to get the target, then use qqbot_send_message to reply in the same conversation.

The README does not provide complete JSON tool input examples; fields follow the tool schema and the table above.

Fitting scenarios and notes

Fits: when you need to push results back to QQ from sessions that do not start on QQ; when notifying users after scheduled or background tasks complete; when working with the dsh-qqbot gateway and using qqbot_current_target to avoid hand-writing targets.

Platform limitations (explicit in the README): proactive messages are subject to QQ Open Platform quotas (private chat c2c is the strictest), and typically can only reach users who have recently interacted with the bot; this plugin cannot bypass these restrictions.

Quality and testing: the repository uses pnpm build, pnpm typecheck, pnpm lint, and node --test as gates; deployment-side token smoke tests are skipped when QQBOT_APPID / QQBOT_SECRET are absent.

Closing

dsh-qqbot-send fills DSH’s proactive outbound capability on the QQ side: send messages via REST, optional Markdown, lossless chunking of long text, and it can work with the dsh-qqbot gateway to resolve the current QQ conversation. For installation and configuration, follow the README; for details, see the SkillHub catalog page and the GitHub repository.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye