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.7.0.tar.gz (31.9 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.0-py3-none-any.whl (36.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nonebot_adapter_qq-1.7.0.tar.gz
  • Upload date:
  • Size: 31.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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.0.tar.gz
Algorithm Hash digest
SHA256 0b4f09562424b42cea79b1d75c4a0bcc06b7280be75ec4ff817ad82e5eb3ff54
MD5 caf9c0bd2d95e6e2389d1057db158070
BLAKE2b-256 f2388ea6c65798f8ba98aec9be869bb155bd1b9e024621b86ea85cb8af8d0da0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nonebot_adapter_qq-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 36.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44987d8bc5cf41f0d42cc975583a370def6e46ff45ccf16ed08f3f219ebbb011
MD5 33148ad90d0a8b03a38c5157d20a3e3a
BLAKE2b-256 1cca86e1f4b591734982fbd66dbbbe94a87bdc3debc857690f9eaffa9e1edb62

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