Skip to main content

nonebot-adapter-qq

NoneBot-Adapter-QQ

✨ QQ 协议适配 ✨

配置

修改 NoneBot 配置文件 .env 或者 .env.*

Driver

如果使用 WebSocket 连接方式,请参考 driver 配置项,添加 HTTPClientWebSocketClient 支持。如:

DRIVER=~httpx+~websockets
DRIVER=~aiohttp

如果使用 WebHook 连接方式,则添加 ASGIServer 支持。如:

DRIVER=~fastapi

QQ_IS_SANDBOX

是否为沙盒模式,默认为 False

QQ_IS_SANDBOX=true

QQ_BOTS

配置机器人帐号 id token secret,intent 需要根据机器人类型以及需要的事件进行配置。

Webhook / WebSocket

通过配置项 use_websocket 来选择是否启用 WebSocket 连接,当前默认为 True。如果关闭 WebSocket 连接方式,则可以通过 WebHook 方式来连接机器人,请在 QQ 开放平台中配置机器人回调地址:https://host:port/qq/webhook

Intent

Intent 仅对 WebSocket 连接方式生效。以下为所有 Intent 配置项以及默认值:

{
  // 频道事件
  "guilds": true,
  // 频道成员事件
  "guild_members": true,
  // 频道消息事件
  "guild_messages": false,
  // 频道消息表态事件
  "guild_message_reactions": true,
  // 频道私信事件
  "direct_message": false,
  // 频道公域论坛事件
  "open_forum_event": false,
  // 频道音频或直播成员事件
  "audio_live_member": false,
  // 群成员变更事件
  "group_members": false,
  // 私聊与群聊消息事件
  "c2c_group_at_messages": false,
  // 互动事件
  "interaction": false,
  // 频道消息审核事件
  "message_audit": true,
  // 频道私域论坛事件
  "forum_event": false,
  // 频道音频操作事件
  "audio_action": false,
  // 频道@机器人消息事件
  "at_messages": true
}

示例

私域频道机器人示例

QQ_BOTS='
[
  {
    "id": "xxx",
    "token": "xxx",
    "secret": "xxx",
    "intent": {
      "guild_messages": true,
      "at_messages": false
    },
    "use_websocket": false
  }
]
'

公域群机器人示例

QQ_BOTS='
[
  {
    "id": "xxx",
    "token": "xxx",
    "secret": "xxx",
    "intent": {
      "c2c_group_at_messages": true,
      "group_members": true
    },
    "use_websocket": false
  }
]
'

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_adapter_qq-1.7.2.tar.gz (34.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_adapter_qq-1.7.2-py3-none-any.whl (39.2 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_adapter_qq-1.7.2.tar.gz.

File metadata

  • Download URL: nonebot_adapter_qq-1.7.2.tar.gz
  • Upload date:
  • Size: 34.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for nonebot_adapter_qq-1.7.2.tar.gz
Algorithm Hash digest
SHA256 07a2a1613def7a0d555597cf9103adf7934167d7f644172252fd69bb4a7f87fa
MD5 2b318c8aa78a5048d1eada24fdd85373
BLAKE2b-256 880a04db32e598a37595ae5bd4908cb483818160ce1981e624353992107a30fd

See more details on using hashes here.

File details

Details for the file nonebot_adapter_qq-1.7.2-py3-none-any.whl.

File metadata

  • Download URL: nonebot_adapter_qq-1.7.2-py3-none-any.whl
  • Upload date:
  • Size: 39.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for nonebot_adapter_qq-1.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 487aa6473c1c9874fe5ed088817589f7c6a09967b8ac468b29a48e41cce4f1e6
MD5 0c344c8d684721c2e6e8741d642663d7
BLAKE2b-256 8c68adcff2c5601d1e35e759b40018fc76aac05fb61481d91a744551a1c3d0fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page