nonebot-adapter-qq 1.5.2__tar.gz → 1.5.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/PKG-INFO +2 -1
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/nonebot/adapters/qq/adapter.py +16 -10
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/pyproject.toml +5 -3
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/LICENSE +0 -0
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/README.md +0 -0
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/nonebot/adapters/qq/__init__.py +0 -0
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/nonebot/adapters/qq/bot.py +0 -0
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/nonebot/adapters/qq/compat.py +0 -0
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/nonebot/adapters/qq/config.py +0 -0
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/nonebot/adapters/qq/event.py +0 -0
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/nonebot/adapters/qq/exception.py +0 -0
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/nonebot/adapters/qq/message.py +0 -0
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/nonebot/adapters/qq/models/__init__.py +0 -0
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/nonebot/adapters/qq/models/common.py +0 -0
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/nonebot/adapters/qq/models/guild.py +0 -0
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/nonebot/adapters/qq/models/payload.py +0 -0
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/nonebot/adapters/qq/models/qq.py +0 -0
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/nonebot/adapters/qq/permission.py +0 -0
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/nonebot/adapters/qq/store.py +0 -0
- {nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/nonebot/adapters/qq/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: nonebot-adapter-qq
|
3
|
-
Version: 1.5.
|
3
|
+
Version: 1.5.3
|
4
4
|
Summary: QQ adapter for nonebot2
|
5
5
|
Home-page: https://github.com/nonebot/adapter-qq
|
6
6
|
License: MIT
|
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.10
|
19
19
|
Classifier: Programming Language :: Python :: 3.11
|
20
20
|
Classifier: Programming Language :: Python :: 3.12
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
21
22
|
Requires-Dist: nonebot2 (>=2.2.1,<3.0.0)
|
22
23
|
Requires-Dist: pydantic (>=1.10.0,<3.0.0,!=2.5.0,!=2.5.1)
|
23
24
|
Requires-Dist: typing-extensions (>=4.4.0,<5.0.0)
|
@@ -46,7 +46,7 @@ class Adapter(BaseAdapter):
|
|
46
46
|
|
47
47
|
self.qq_config: Config = Config(**self.config.dict())
|
48
48
|
|
49
|
-
self.tasks:
|
49
|
+
self.tasks: set["asyncio.Task"] = set()
|
50
50
|
self.setup()
|
51
51
|
|
52
52
|
@classmethod
|
@@ -85,7 +85,9 @@ class Adapter(BaseAdapter):
|
|
85
85
|
log("DEBUG", f"QQ api base url: <y>{escape_tag(str(api_base))}</y>")
|
86
86
|
|
87
87
|
for bot in self.qq_config.qq_bots:
|
88
|
-
|
88
|
+
task = asyncio.create_task(self.run_bot(bot))
|
89
|
+
task.add_done_callback(self.tasks.discard)
|
90
|
+
self.tasks.add(task)
|
89
91
|
|
90
92
|
async def shutdown(self) -> None:
|
91
93
|
for task in self.tasks:
|
@@ -123,17 +125,17 @@ class Adapter(BaseAdapter):
|
|
123
125
|
|
124
126
|
# start connection in single shard mode
|
125
127
|
if bot_info.shard is not None:
|
126
|
-
self.
|
127
|
-
|
128
|
-
)
|
128
|
+
task = asyncio.create_task(self._forward_ws(bot, ws_url, bot_info.shard))
|
129
|
+
task.add_done_callback(self.tasks.discard)
|
130
|
+
self.tasks.add(task)
|
129
131
|
return
|
130
132
|
|
131
133
|
# start connection in sharding mode
|
132
134
|
shards = gateway_info.shards or 1
|
133
135
|
for i in range(shards):
|
134
|
-
self.
|
135
|
-
|
136
|
-
)
|
136
|
+
task = asyncio.create_task(self._forward_ws(bot, ws_url, (i, shards)))
|
137
|
+
task.add_done_callback(self.tasks.discard)
|
138
|
+
self.tasks.add(task)
|
137
139
|
# wait for session start concurrency limit
|
138
140
|
await asyncio.sleep(gateway_info.session_start_limit.max_concurrency or 1)
|
139
141
|
|
@@ -318,7 +320,9 @@ class Adapter(BaseAdapter):
|
|
318
320
|
)
|
319
321
|
|
320
322
|
if ready_event:
|
321
|
-
asyncio.create_task(bot.handle_event(ready_event))
|
323
|
+
task = asyncio.create_task(bot.handle_event(ready_event))
|
324
|
+
task.add_done_callback(self.tasks.discard)
|
325
|
+
self.tasks.add(task)
|
322
326
|
|
323
327
|
return True
|
324
328
|
|
@@ -354,7 +358,9 @@ class Adapter(BaseAdapter):
|
|
354
358
|
else:
|
355
359
|
if isinstance(event, MessageAuditEvent):
|
356
360
|
audit_result.add_result(event)
|
357
|
-
asyncio.create_task(bot.handle_event(event))
|
361
|
+
task = asyncio.create_task(bot.handle_event(event))
|
362
|
+
task.add_done_callback(self.tasks.discard)
|
363
|
+
self.tasks.add(task)
|
358
364
|
elif isinstance(payload, HeartbeatAck):
|
359
365
|
log("TRACE", "Heartbeat ACK")
|
360
366
|
continue
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "nonebot-adapter-qq"
|
3
|
-
version = "1.5.
|
3
|
+
version = "1.5.3"
|
4
4
|
description = "QQ adapter for nonebot2"
|
5
5
|
authors = ["yanyongyu <yyy@nonebot.dev>"]
|
6
6
|
license = "MIT"
|
@@ -26,11 +26,11 @@ typing-extensions = ">=4.4.0, <5.0.0"
|
|
26
26
|
pydantic = ">=1.10.0,<3.0.0,!=2.5.0,!=2.5.1"
|
27
27
|
|
28
28
|
[tool.poetry.group.dev.dependencies]
|
29
|
-
ruff = "^0.
|
29
|
+
ruff = "^0.7.0"
|
30
30
|
isort = "^5.10.1"
|
31
31
|
black = "^24.0.0"
|
32
32
|
nonemoji = "^0.1.3"
|
33
|
-
pre-commit = "^
|
33
|
+
pre-commit = "^4.0.0"
|
34
34
|
|
35
35
|
[tool.black]
|
36
36
|
line-length = 88
|
@@ -85,6 +85,8 @@ defineConstant = { PYDANTIC_V2 = true }
|
|
85
85
|
typeCheckingMode = "standard"
|
86
86
|
reportShadowedImports = false
|
87
87
|
disableBytesTypePromotions = true
|
88
|
+
reportIncompatibleMethodOverride = false
|
89
|
+
reportIncompatibleVariableOverride = false
|
88
90
|
|
89
91
|
[build-system]
|
90
92
|
requires = ["poetry-core>=1.0.0"]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{nonebot_adapter_qq-1.5.2 → nonebot_adapter_qq-1.5.3}/nonebot/adapters/qq/models/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|