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.1.tar.gz (33.1 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.1-py3-none-any.whl (37.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nonebot_adapter_qq-1.7.1.tar.gz
  • Upload date:
  • Size: 33.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","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.1.tar.gz
Algorithm Hash digest
SHA256 cc7891fda36155ea9c7524273bbe8b4f6a4637340668c04503aad80f451ca9c5
MD5 08345882263fe695a4758377324e7b56
BLAKE2b-256 5522c2063502050372297c532f76d414582ae185545a842f4829056f7a73f9e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nonebot_adapter_qq-1.7.1-py3-none-any.whl
  • Upload date:
  • Size: 37.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9cd41d4ae56bc31b15681e3fdb63c599770dddf35fce381c232b9ec1b68f53f8
MD5 662b841cafa523ce622a6033ab48b22a
BLAKE2b-256 44bae9eb92190889c23126e902da7b5f393548429781fa4faef54aab98d4409e

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