nonebot-adapter-qq 1.6.1__tar.gz → 1.6.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.6.1 → nonebot_adapter_qq-1.6.3}/PKG-INFO +2 -2
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/nonebot/adapters/qq/adapter.py +25 -25
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/nonebot/adapters/qq/bot.py +96 -61
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/nonebot/adapters/qq/compat.py +1 -1
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/nonebot/adapters/qq/config.py +2 -1
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/nonebot/adapters/qq/event.py +18 -13
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/nonebot/adapters/qq/message.py +8 -9
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/nonebot/adapters/qq/models/guild.py +6 -6
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/nonebot/adapters/qq/models/payload.py +3 -2
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/nonebot/adapters/qq/permission.py +1 -1
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/nonebot/adapters/qq/utils.py +3 -3
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/pyproject.toml +10 -3
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/LICENSE +0 -0
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/README.md +0 -0
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/nonebot/adapters/qq/__init__.py +9 -9
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/nonebot/adapters/qq/exception.py +2 -2
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/nonebot/adapters/qq/models/__init__.py +9 -9
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/nonebot/adapters/qq/models/common.py +1 -1
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/nonebot/adapters/qq/models/qq.py +1 -1
- {nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/nonebot/adapters/qq/store.py +0 -0
@@ -1,8 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: nonebot-adapter-qq
|
3
|
-
Version: 1.6.
|
3
|
+
Version: 1.6.3
|
4
4
|
Summary: QQ adapter for nonebot2
|
5
|
-
Home-page: https://github.com/nonebot/adapter-qq
|
6
5
|
License: MIT
|
7
6
|
Keywords: bot,qq,qqbot,qqguild
|
8
7
|
Author: yanyongyu
|
@@ -25,6 +24,7 @@ Requires-Dist: pydantic (>=1.10.0,<3.0.0,!=2.5.0,!=2.5.1)
|
|
25
24
|
Requires-Dist: typing-extensions (>=4.4.0,<5.0.0)
|
26
25
|
Requires-Dist: yarl (>=1.9.0,<2.0.0)
|
27
26
|
Project-URL: Documentation, https://github.com/nonebot/adapter-qq#readme
|
27
|
+
Project-URL: Homepage, https://github.com/nonebot/adapter-qq
|
28
28
|
Project-URL: Repository, https://github.com/nonebot/adapter-qq
|
29
29
|
Description-Content-Type: text/markdown
|
30
30
|
|
@@ -1,49 +1,49 @@
|
|
1
|
-
import sys
|
2
|
-
import json
|
3
1
|
import asyncio
|
4
2
|
import binascii
|
3
|
+
import json
|
4
|
+
import sys
|
5
|
+
from typing import Any, Literal, Optional, Union, cast
|
5
6
|
from typing_extensions import override
|
6
|
-
from typing import Any, Union, Literal, Optional, cast
|
7
7
|
|
8
|
-
from nonebot.utils import escape_tag
|
9
|
-
from nonebot.exception import WebSocketClosed
|
10
8
|
from cryptography.exceptions import InvalidSignature
|
11
9
|
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey
|
10
|
+
|
11
|
+
from nonebot import get_plugin_config
|
12
|
+
from nonebot.adapters import Adapter as BaseAdapter
|
12
13
|
from nonebot.compat import PYDANTIC_V2, type_validate_json, type_validate_python
|
13
14
|
from nonebot.drivers import (
|
14
15
|
URL,
|
16
|
+
ASGIMixin,
|
15
17
|
Driver,
|
18
|
+
HTTPClientMixin,
|
19
|
+
HTTPServerSetup,
|
16
20
|
Request,
|
17
21
|
Response,
|
18
|
-
ASGIMixin,
|
19
22
|
WebSocket,
|
20
|
-
HTTPClientMixin,
|
21
|
-
HTTPServerSetup,
|
22
23
|
WebSocketClientMixin,
|
23
24
|
)
|
24
|
-
|
25
|
-
from nonebot import
|
26
|
-
from nonebot.adapters import Adapter as BaseAdapter
|
25
|
+
from nonebot.exception import WebSocketClosed
|
26
|
+
from nonebot.utils import escape_tag
|
27
27
|
|
28
28
|
from .bot import Bot
|
29
|
-
from .
|
30
|
-
from .
|
31
|
-
from .config import Config, BotInfo
|
29
|
+
from .config import BotInfo, Config
|
30
|
+
from .event import EVENT_CLASSES, Event, MessageAuditEvent, ReadyEvent
|
32
31
|
from .exception import ApiNotAvailable
|
33
|
-
from .event import EVENT_CLASSES, Event, ReadyEvent, MessageAuditEvent
|
34
32
|
from .models import (
|
35
|
-
Hello,
|
36
|
-
Resume,
|
37
|
-
Payload,
|
38
33
|
Dispatch,
|
39
|
-
Identify,
|
40
34
|
Heartbeat,
|
41
|
-
Reconnect,
|
42
|
-
PayloadType,
|
43
35
|
HeartbeatAck,
|
44
|
-
|
36
|
+
Hello,
|
37
|
+
Identify,
|
45
38
|
InvalidSession,
|
39
|
+
Payload,
|
40
|
+
PayloadType,
|
41
|
+
Reconnect,
|
42
|
+
Resume,
|
43
|
+
WebhookVerify,
|
46
44
|
)
|
45
|
+
from .store import audit_result
|
46
|
+
from .utils import API, log
|
47
47
|
|
48
48
|
RECONNECT_INTERVAL = 3.0
|
49
49
|
|
@@ -268,9 +268,9 @@ class Adapter(BaseAdapter):
|
|
268
268
|
"""接收并处理服务器的 Hello 事件"""
|
269
269
|
try:
|
270
270
|
payload = await self.receive_payload(bot, ws)
|
271
|
-
assert isinstance(
|
272
|
-
payload
|
273
|
-
)
|
271
|
+
assert isinstance(payload, Hello), (
|
272
|
+
f"Received unexpected payload: {payload!r}"
|
273
|
+
)
|
274
274
|
return payload.data.heartbeat_interval
|
275
275
|
except Exception as e:
|
276
276
|
log(
|
@@ -1,89 +1,95 @@
|
|
1
|
-
import json
|
2
1
|
from base64 import b64encode
|
3
|
-
from
|
4
|
-
from datetime import datetime,
|
2
|
+
from contextlib import suppress
|
3
|
+
from datetime import datetime, timedelta, timezone
|
4
|
+
import json
|
5
5
|
from typing import (
|
6
6
|
IO,
|
7
7
|
TYPE_CHECKING,
|
8
8
|
Any,
|
9
|
-
Union,
|
10
9
|
Literal,
|
11
10
|
NoReturn,
|
12
11
|
Optional,
|
12
|
+
Union,
|
13
13
|
cast,
|
14
14
|
overload,
|
15
15
|
)
|
16
|
+
from typing_extensions import Never, override
|
16
17
|
|
17
18
|
from pydantic import BaseModel
|
18
|
-
from nonebot.message import handle_event
|
19
|
-
from nonebot.drivers import Request, Response
|
20
|
-
from nonebot.compat import type_validate_python
|
21
19
|
|
22
20
|
from nonebot.adapters import Bot as BaseBot
|
21
|
+
from nonebot.compat import type_validate_python
|
22
|
+
from nonebot.drivers import Request, Response
|
23
|
+
from nonebot.message import handle_event
|
23
24
|
|
24
25
|
from .config import BotInfo
|
25
|
-
from .
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
from .event import (
|
27
|
+
C2CMessageCreateEvent,
|
28
|
+
DirectMessageCreateEvent,
|
29
|
+
Event,
|
30
|
+
GroupAtMessageCreateEvent,
|
31
|
+
GuildMessageEvent,
|
32
|
+
InteractionCreateEvent,
|
33
|
+
QQMessageEvent,
|
34
|
+
ReadyEvent,
|
35
|
+
)
|
29
36
|
from .exception import (
|
30
37
|
ActionFailed,
|
31
|
-
NetworkError,
|
32
|
-
AuditException,
|
33
38
|
ApiNotAvailable,
|
39
|
+
AuditException,
|
40
|
+
NetworkError,
|
34
41
|
RateLimitException,
|
35
42
|
UnauthorizedException,
|
36
43
|
)
|
37
|
-
from .
|
38
|
-
Event,
|
39
|
-
ReadyEvent,
|
40
|
-
QQMessageEvent,
|
41
|
-
GuildMessageEvent,
|
42
|
-
C2CMessageCreateEvent,
|
43
|
-
InteractionCreateEvent,
|
44
|
-
DirectMessageCreateEvent,
|
45
|
-
GroupAtMessageCreateEvent,
|
46
|
-
)
|
44
|
+
from .message import Message, MessageSegment
|
47
45
|
from .models import (
|
46
|
+
DMS,
|
47
|
+
APIPermissionDemand,
|
48
|
+
APIPermissionDemandIdentify,
|
49
|
+
AudioControl,
|
50
|
+
AudioStatus,
|
51
|
+
Channel,
|
52
|
+
ChannelPermissions,
|
53
|
+
ChannelSubType,
|
54
|
+
ChannelType,
|
48
55
|
Dispatch,
|
49
|
-
RichText,
|
50
|
-
Schedule,
|
51
56
|
EmojiType,
|
57
|
+
GetGuildAPIPermissionReturn,
|
58
|
+
GetGuildRolesReturn,
|
59
|
+
GetReactionUsersReturn,
|
60
|
+
GetRoleMembersReturn,
|
61
|
+
GetThreadReturn,
|
62
|
+
GetThreadsListReturn,
|
63
|
+
Guild,
|
64
|
+
Media,
|
65
|
+
Member,
|
52
66
|
MessageArk,
|
53
|
-
RemindType,
|
54
|
-
AudioStatus,
|
55
|
-
ChannelType,
|
56
|
-
PinsMessage,
|
57
|
-
PrivateType,
|
58
|
-
AudioControl,
|
59
67
|
MessageEmbed,
|
60
|
-
UrlGetReturn,
|
61
|
-
ChannelSubType,
|
62
|
-
MessageSetting,
|
63
|
-
GetThreadReturn,
|
64
68
|
MessageKeyboard,
|
65
69
|
MessageMarkdown,
|
66
|
-
PutThreadReturn,
|
67
|
-
SpeakPermission,
|
68
70
|
MessageReference,
|
69
|
-
|
70
|
-
ShardUrlGetReturn,
|
71
|
-
ChannelPermissions,
|
72
|
-
PostC2CFilesReturn,
|
73
|
-
APIPermissionDemand,
|
74
|
-
GetGuildRolesReturn,
|
75
|
-
PostGuildRoleReturn,
|
76
|
-
GetRoleMembersReturn,
|
77
|
-
GetThreadsListReturn,
|
71
|
+
MessageSetting,
|
78
72
|
PatchGuildRoleReturn,
|
79
|
-
|
73
|
+
PinsMessage,
|
74
|
+
PostC2CFilesReturn,
|
80
75
|
PostC2CMessagesReturn,
|
81
|
-
|
76
|
+
PostGroupFilesReturn,
|
82
77
|
PostGroupMembersReturn,
|
83
78
|
PostGroupMessagesReturn,
|
84
|
-
|
85
|
-
|
79
|
+
PostGuildRoleReturn,
|
80
|
+
PrivateType,
|
81
|
+
PutThreadReturn,
|
82
|
+
RecommendChannel,
|
83
|
+
RemindType,
|
84
|
+
RichText,
|
85
|
+
Schedule,
|
86
|
+
ShardUrlGetReturn,
|
87
|
+
SpeakPermission,
|
88
|
+
UrlGetReturn,
|
89
|
+
User,
|
86
90
|
)
|
91
|
+
from .models import Message as GuildMessage
|
92
|
+
from .utils import API, exclude_none, log
|
87
93
|
|
88
94
|
if TYPE_CHECKING:
|
89
95
|
from .adapter import Adapter
|
@@ -255,6 +261,15 @@ class Bot(BaseBot):
|
|
255
261
|
" Please check your config."
|
256
262
|
)
|
257
263
|
data = json.loads(resp.content)
|
264
|
+
if (
|
265
|
+
not isinstance(data, dict)
|
266
|
+
or "access_token" not in data
|
267
|
+
or "expires_in" not in data
|
268
|
+
):
|
269
|
+
raise NetworkError(
|
270
|
+
f"Get authorization failed with invalid response {data!r}."
|
271
|
+
" Please check your config."
|
272
|
+
)
|
258
273
|
self._access_token = cast(str, data["access_token"])
|
259
274
|
self._expires_in = datetime.now(timezone.utc) + timedelta(
|
260
275
|
seconds=int(data["expires_in"])
|
@@ -387,7 +402,7 @@ class Bot(BaseBot):
|
|
387
402
|
msg_type = 4
|
388
403
|
elif kwargs.get("ark"):
|
389
404
|
msg_type = 3
|
390
|
-
elif kwargs.get("markdown"):
|
405
|
+
elif kwargs.get("markdown") or kwargs.get("keyboard"):
|
391
406
|
msg_type = 2
|
392
407
|
elif (
|
393
408
|
message["image"]
|
@@ -531,6 +546,23 @@ class Bot(BaseBot):
|
|
531
546
|
raise RuntimeError("Event cannot be replied to!")
|
532
547
|
|
533
548
|
# API request methods
|
549
|
+
def _handle_audit(self, response: Response) -> None:
|
550
|
+
if 200 <= response.status_code <= 202:
|
551
|
+
with suppress(json.JSONDecodeError):
|
552
|
+
if (
|
553
|
+
response.content
|
554
|
+
and (content := json.loads(response.content))
|
555
|
+
and isinstance(content, dict)
|
556
|
+
and (
|
557
|
+
audit_id := (
|
558
|
+
content.get("data", {})
|
559
|
+
.get("message_audit", {})
|
560
|
+
.get("audit_id", None)
|
561
|
+
)
|
562
|
+
)
|
563
|
+
):
|
564
|
+
raise AuditException(audit_id)
|
565
|
+
|
534
566
|
def _handle_response(self, response: Response) -> Any:
|
535
567
|
if trace_id := response.headers.get("X-Tps-trace-ID", None):
|
536
568
|
log(
|
@@ -538,15 +570,10 @@ class Bot(BaseBot):
|
|
538
570
|
f"Called API {response.request and response.request.url} "
|
539
571
|
f"response {response.status_code} with trace id {trace_id}",
|
540
572
|
)
|
573
|
+
|
574
|
+
self._handle_audit(response)
|
575
|
+
|
541
576
|
if response.status_code == 201 or response.status_code == 202:
|
542
|
-
if response.content and (content := json.loads(response.content)):
|
543
|
-
audit_id = (
|
544
|
-
content.get("data", {})
|
545
|
-
.get("message_audit", {})
|
546
|
-
.get("audit_id", None)
|
547
|
-
)
|
548
|
-
if audit_id:
|
549
|
-
raise AuditException(audit_id)
|
550
577
|
raise ActionFailed(response)
|
551
578
|
elif 200 <= response.status_code < 300:
|
552
579
|
return response.content and json.loads(response.content)
|
@@ -1680,7 +1707,11 @@ class Bot(BaseBot):
|
|
1680
1707
|
embed.dict(exclude_none=True) if embed is not None else None
|
1681
1708
|
),
|
1682
1709
|
"image": image,
|
1683
|
-
"message_reference":
|
1710
|
+
"message_reference": (
|
1711
|
+
message_reference.dict(exclude_none=True)
|
1712
|
+
if message_reference is not None
|
1713
|
+
else None
|
1714
|
+
),
|
1684
1715
|
"event_id": event_id,
|
1685
1716
|
"msg_id": msg_id,
|
1686
1717
|
"msg_seq": msg_seq,
|
@@ -1782,7 +1813,11 @@ class Bot(BaseBot):
|
|
1782
1813
|
embed.dict(exclude_none=True) if embed is not None else None
|
1783
1814
|
),
|
1784
1815
|
"image": image,
|
1785
|
-
"message_reference":
|
1816
|
+
"message_reference": (
|
1817
|
+
message_reference.dict(exclude_none=True)
|
1818
|
+
if message_reference is not None
|
1819
|
+
else None
|
1820
|
+
),
|
1786
1821
|
"event_id": event_id,
|
1787
1822
|
"msg_id": msg_id,
|
1788
1823
|
"msg_seq": msg_seq,
|
@@ -8,7 +8,7 @@ if PYDANTIC_V2:
|
|
8
8
|
from pydantic import field_validator as field_validator
|
9
9
|
from pydantic import model_validator as model_validator
|
10
10
|
else:
|
11
|
-
from pydantic import
|
11
|
+
from pydantic import root_validator, validator
|
12
12
|
|
13
13
|
@overload
|
14
14
|
def model_validator(*, mode: Literal["before"]): ...
|
@@ -1,28 +1,33 @@
|
|
1
|
-
from enum import Enum
|
2
1
|
from datetime import datetime
|
2
|
+
from enum import Enum
|
3
|
+
from typing import Optional, TypeVar, cast
|
3
4
|
from typing_extensions import override
|
4
|
-
from typing import TypeVar, Optional, cast
|
5
|
-
|
6
|
-
from nonebot.utils import escape_tag
|
7
5
|
|
8
6
|
from nonebot.adapters import Event as BaseEvent
|
7
|
+
from nonebot.utils import escape_tag
|
9
8
|
|
10
9
|
from .message import Message
|
11
|
-
from .models import Message as GuildMessage
|
12
|
-
from .models import Post, User, Guild, Reply, Member, Thread, Channel
|
13
10
|
from .models import (
|
14
|
-
RichText,
|
15
|
-
QQMessage,
|
16
11
|
AudioAction,
|
12
|
+
ButtonInteraction,
|
13
|
+
Channel,
|
14
|
+
ForumAuditResult,
|
15
|
+
ForumSourceInfo,
|
17
16
|
FriendAuthor,
|
18
|
-
|
17
|
+
GroupMemberAuthor,
|
18
|
+
Guild,
|
19
|
+
Member,
|
19
20
|
MessageAudited,
|
20
|
-
|
21
|
+
MessageDelete,
|
21
22
|
MessageReaction,
|
22
|
-
|
23
|
-
|
24
|
-
|
23
|
+
Post,
|
24
|
+
QQMessage,
|
25
|
+
Reply,
|
26
|
+
RichText,
|
27
|
+
Thread,
|
28
|
+
User,
|
25
29
|
)
|
30
|
+
from .models import Message as GuildMessage
|
26
31
|
|
27
32
|
E = TypeVar("E", bound="Event")
|
28
33
|
|
@@ -1,27 +1,26 @@
|
|
1
|
-
import
|
1
|
+
from collections.abc import Iterable
|
2
|
+
from dataclasses import dataclass
|
2
3
|
from io import BytesIO
|
3
4
|
from pathlib import Path
|
4
|
-
|
5
|
-
from
|
5
|
+
import re
|
6
|
+
from typing import TYPE_CHECKING, Optional, TypedDict, Union, overload
|
6
7
|
from typing_extensions import Self, override
|
7
|
-
from typing import TYPE_CHECKING, Union, Optional, TypedDict, overload
|
8
|
-
|
9
|
-
from nonebot.compat import type_validate_python
|
10
8
|
|
11
9
|
from nonebot.adapters import Message as BaseMessage
|
12
10
|
from nonebot.adapters import MessageSegment as BaseMessageSegment
|
11
|
+
from nonebot.compat import type_validate_python
|
13
12
|
|
14
|
-
from .models import QQMessage
|
15
|
-
from .utils import escape, unescape
|
16
|
-
from .models import Message as GuildMessage
|
17
13
|
from .models import Attachment as QQAttachment
|
14
|
+
from .models import Message as GuildMessage
|
18
15
|
from .models import (
|
19
16
|
MessageArk,
|
20
17
|
MessageEmbed,
|
21
18
|
MessageKeyboard,
|
22
19
|
MessageMarkdown,
|
23
20
|
MessageReference,
|
21
|
+
QQMessage,
|
24
22
|
)
|
23
|
+
from .utils import escape, unescape
|
25
24
|
|
26
25
|
|
27
26
|
class MessageSegment(BaseMessageSegment["Message"]):
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import json
|
2
|
-
from enum import IntEnum
|
3
1
|
from datetime import datetime
|
4
|
-
from
|
2
|
+
from enum import IntEnum
|
3
|
+
import json
|
4
|
+
from typing import Generic, Optional, TypeVar, Union
|
5
5
|
|
6
6
|
from pydantic import BaseModel
|
7
|
-
from nonebot.compat import PYDANTIC_V2, model_fields, type_validate_python
|
8
7
|
|
9
8
|
from nonebot.adapters.qq.compat import field_validator, model_validator
|
9
|
+
from nonebot.compat import PYDANTIC_V2, model_fields, type_validate_python
|
10
10
|
|
11
|
-
from .common import MessageArk, MessageEmbed, MessageReference
|
11
|
+
from .common import MessageArk, MessageAttachment, MessageEmbed, MessageReference
|
12
12
|
|
13
13
|
if PYDANTIC_V2:
|
14
14
|
GenericModel = BaseModel
|
@@ -363,7 +363,7 @@ class Paragraph(BaseModel):
|
|
363
363
|
|
364
364
|
|
365
365
|
class RichText(BaseModel):
|
366
|
-
paragraphs: list[Paragraph]
|
366
|
+
paragraphs: Optional[list[Paragraph]] = None
|
367
367
|
|
368
368
|
|
369
369
|
class ThreadObjectInfo(BaseModel):
|
@@ -1,8 +1,9 @@
|
|
1
1
|
from enum import IntEnum
|
2
|
+
from typing import Annotated, Optional, Union
|
2
3
|
from typing_extensions import Literal
|
3
|
-
from typing import Union, Optional, Annotated
|
4
4
|
|
5
|
-
from pydantic import
|
5
|
+
from pydantic import BaseModel, Field
|
6
|
+
|
6
7
|
from nonebot.compat import PYDANTIC_V2, ConfigDict
|
7
8
|
|
8
9
|
PAYLOAD_FIELD_ALIASES = {"opcode": "op", "data": "d", "sequence": "s", "type": "t"}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
from functools import partial
|
2
1
|
from collections.abc import Awaitable
|
3
|
-
from
|
4
|
-
from typing import TYPE_CHECKING, Any,
|
2
|
+
from functools import partial
|
3
|
+
from typing import TYPE_CHECKING, Any, Callable, Generic, Optional, TypeVar, overload
|
4
|
+
from typing_extensions import Concatenate, ParamSpec
|
5
5
|
|
6
6
|
from nonebot.utils import logger_wrapper
|
7
7
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "nonebot-adapter-qq"
|
3
|
-
version = "1.6.
|
3
|
+
version = "1.6.3"
|
4
4
|
description = "QQ adapter for nonebot2"
|
5
5
|
authors = ["yanyongyu <yyy@nonebot.dev>"]
|
6
6
|
license = "MIT"
|
@@ -27,8 +27,7 @@ typing-extensions = ">=4.4.0, <5.0.0"
|
|
27
27
|
pydantic = ">=1.10.0,<3.0.0,!=2.5.0,!=2.5.1"
|
28
28
|
|
29
29
|
[tool.poetry.group.dev.dependencies]
|
30
|
-
ruff = "^0.
|
31
|
-
isort = "^5.10.1"
|
30
|
+
ruff = "^0.11.0"
|
32
31
|
nonemoji = "^0.1.3"
|
33
32
|
pre-commit = "^4.0.0"
|
34
33
|
|
@@ -49,6 +48,7 @@ select = [
|
|
49
48
|
"F", # Pyflakes
|
50
49
|
"W", # pycodestyle warnings
|
51
50
|
"E", # pycodestyle errors
|
51
|
+
"I", # isort
|
52
52
|
"UP", # pyupgrade
|
53
53
|
"ASYNC", # flake8-async
|
54
54
|
"C4", # flake8-comprehensions
|
@@ -67,10 +67,17 @@ ignore = [
|
|
67
67
|
"RUF003", # ambiguous-unicode-character-comment
|
68
68
|
]
|
69
69
|
|
70
|
+
[tool.ruff.lint.isort]
|
71
|
+
force-sort-within-sections = true
|
72
|
+
extra-standard-library = ["typing_extensions"]
|
73
|
+
|
70
74
|
[tool.ruff.lint.flake8-pytest-style]
|
71
75
|
fixture-parentheses = false
|
72
76
|
mark-parentheses = false
|
73
77
|
|
78
|
+
[tool.ruff.lint.pyupgrade]
|
79
|
+
keep-runtime-typing = true
|
80
|
+
|
74
81
|
[tool.pyright]
|
75
82
|
pythonVersion = "3.9"
|
76
83
|
pythonPlatform = "All"
|
File without changes
|
File without changes
|
@@ -1,17 +1,17 @@
|
|
1
|
+
from .adapter import Adapter as Adapter
|
1
2
|
from .bot import Bot as Bot
|
2
|
-
from .utils import log as log
|
3
3
|
from .event import * # noqa: F403
|
4
|
-
from .utils import escape as escape
|
5
|
-
from .adapter import Adapter as Adapter
|
6
|
-
from .message import Message as Message
|
7
|
-
from .permission import * # noqa: F403
|
8
|
-
from .utils import unescape as unescape
|
9
4
|
from .exception import ActionFailed as ActionFailed
|
10
|
-
from .exception import
|
11
|
-
from .message import MessageSegment as MessageSegment
|
5
|
+
from .exception import ApiNotAvailable as ApiNotAvailable
|
12
6
|
from .exception import AuditException as AuditException
|
7
|
+
from .exception import NetworkError as NetworkError
|
13
8
|
from .exception import NoLogException as NoLogException
|
14
|
-
from .exception import ApiNotAvailable as ApiNotAvailable
|
15
9
|
from .exception import QQAdapterException as QQAdapterException
|
16
10
|
from .exception import RateLimitException as RateLimitException
|
17
11
|
from .exception import UnauthorizedException as UnauthorizedException
|
12
|
+
from .message import Message as Message
|
13
|
+
from .message import MessageSegment as MessageSegment
|
14
|
+
from .permission import * # noqa: F403
|
15
|
+
from .utils import escape as escape
|
16
|
+
from .utils import log as log
|
17
|
+
from .utils import unescape as unescape
|
@@ -2,11 +2,11 @@ import json
|
|
2
2
|
from typing import Optional
|
3
3
|
|
4
4
|
from nonebot.drivers import Response
|
5
|
-
from nonebot.exception import AdapterException
|
6
5
|
from nonebot.exception import ActionFailed as BaseActionFailed
|
6
|
+
from nonebot.exception import AdapterException
|
7
|
+
from nonebot.exception import ApiNotAvailable as BaseApiNotAvailable
|
7
8
|
from nonebot.exception import NetworkError as BaseNetworkError
|
8
9
|
from nonebot.exception import NoLogException as BaseNoLogException
|
9
|
-
from nonebot.exception import ApiNotAvailable as BaseApiNotAvailable
|
10
10
|
|
11
11
|
from .store import audit_result
|
12
12
|
|
{nonebot_adapter_qq-1.6.1 → nonebot_adapter_qq-1.6.3}/nonebot/adapters/qq/models/__init__.py
RENAMED
@@ -1,15 +1,15 @@
|
|
1
|
-
from .qq import * # noqa: F403
|
2
|
-
from .guild import * # noqa: F403
|
3
1
|
from .common import * # noqa: F403
|
2
|
+
from .guild import * # noqa: F403
|
3
|
+
from .payload import Dispatch as Dispatch
|
4
|
+
from .payload import Heartbeat as Heartbeat
|
5
|
+
from .payload import HeartbeatAck as HeartbeatAck
|
4
6
|
from .payload import Hello as Hello
|
7
|
+
from .payload import Identify as Identify
|
8
|
+
from .payload import InvalidSession as InvalidSession
|
5
9
|
from .payload import Opcode as Opcode
|
6
|
-
from .payload import Resume as Resume
|
7
10
|
from .payload import Payload as Payload
|
8
|
-
from .payload import Dispatch as Dispatch
|
9
|
-
from .payload import Identify as Identify
|
10
|
-
from .payload import Heartbeat as Heartbeat
|
11
|
-
from .payload import Reconnect as Reconnect
|
12
11
|
from .payload import PayloadType as PayloadType
|
13
|
-
from .payload import
|
12
|
+
from .payload import Reconnect as Reconnect
|
13
|
+
from .payload import Resume as Resume
|
14
14
|
from .payload import WebhookVerify as WebhookVerify
|
15
|
-
from .
|
15
|
+
from .qq import * # noqa: F403
|
File without changes
|