Skip to main content

QQ adapter for nonebot2

Project description

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,
  "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
    },
    "use_websocket": false
  }
]
'

Project details


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.6.6.tar.gz (31.0 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.6.6-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nonebot_adapter_qq-1.6.6.tar.gz
  • Upload date:
  • Size: 31.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"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.6.6.tar.gz
Algorithm Hash digest
SHA256 536f98b3b3ce7a8e3f01e74a59aafa7f90136bc7a2e4f72a3ff1cf1187e57ade
MD5 9cf0a45901472b2b78123738624b2c89
BLAKE2b-256 66e29645b8d99151b44762c44e1103527b2b82e078e9069b9bcee243727cbb3f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nonebot_adapter_qq-1.6.6-py3-none-any.whl
  • Upload date:
  • Size: 36.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"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.6.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9ec76b8f68a16f4e667fd2f2f7c39d8c38f235851732acda7928649764c0bb7c
MD5 1a0d8fc762fee87c038972d0a652e0c2
BLAKE2b-256 65910d8d65ca10aaa02e2f74f0589d2ab7013e84f1779fb8929b5b9c9eb0b957

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 Pingdom Monitoring Sentry Error logging StatusPage Status page