satori-python-adapter-milky 0.4.0__tar.gz → 0.4.1__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.
- {satori_python_adapter_milky-0.4.0 → satori_python_adapter_milky-0.4.1}/.mina/adapter_milky.toml +1 -1
- {satori_python_adapter_milky-0.4.0 → satori_python_adapter_milky-0.4.1}/PKG-INFO +1 -1
- {satori_python_adapter_milky-0.4.0 → satori_python_adapter_milky-0.4.1}/pyproject.toml +1 -1
- {satori_python_adapter_milky-0.4.0 → satori_python_adapter_milky-0.4.1}/src/satori/adapters/milky/events/group.py +22 -2
- {satori_python_adapter_milky-0.4.0 → satori_python_adapter_milky-0.4.1}/LICENSE +0 -0
- {satori_python_adapter_milky-0.4.0 → satori_python_adapter_milky-0.4.1}/README.md +0 -0
- {satori_python_adapter_milky-0.4.0 → satori_python_adapter_milky-0.4.1}/src/satori/adapters/milky/__init__.py +0 -0
- {satori_python_adapter_milky-0.4.0 → satori_python_adapter_milky-0.4.1}/src/satori/adapters/milky/api.py +0 -0
- {satori_python_adapter_milky-0.4.0 → satori_python_adapter_milky-0.4.1}/src/satori/adapters/milky/base.py +0 -0
- {satori_python_adapter_milky-0.4.0 → satori_python_adapter_milky-0.4.1}/src/satori/adapters/milky/events/__init__.py +0 -0
- {satori_python_adapter_milky-0.4.0 → satori_python_adapter_milky-0.4.1}/src/satori/adapters/milky/events/base.py +0 -0
- {satori_python_adapter_milky-0.4.0 → satori_python_adapter_milky-0.4.1}/src/satori/adapters/milky/events/message.py +0 -0
- {satori_python_adapter_milky-0.4.0 → satori_python_adapter_milky-0.4.1}/src/satori/adapters/milky/events/request.py +0 -0
- {satori_python_adapter_milky-0.4.0 → satori_python_adapter_milky-0.4.1}/src/satori/adapters/milky/main.py +0 -0
- {satori_python_adapter_milky-0.4.0 → satori_python_adapter_milky-0.4.1}/src/satori/adapters/milky/message.py +0 -0
- {satori_python_adapter_milky-0.4.0 → satori_python_adapter_milky-0.4.1}/src/satori/adapters/milky/sse.py +0 -0
- {satori_python_adapter_milky-0.4.0 → satori_python_adapter_milky-0.4.1}/src/satori/adapters/milky/utils.py +0 -0
- {satori_python_adapter_milky-0.4.0 → satori_python_adapter_milky-0.4.1}/src/satori/adapters/milky/webhook.py +0 -0
|
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
from datetime import datetime
|
|
4
4
|
|
|
5
5
|
from satori import EventType
|
|
6
|
-
from satori.model import Channel, ChannelType, Event, Guild, Member, User
|
|
6
|
+
from satori.model import Channel, ChannelType, Event, Guild, Member, Role, User
|
|
7
7
|
|
|
8
8
|
from ..utils import group_avatar, user_avatar
|
|
9
9
|
from .base import register_event
|
|
@@ -15,8 +15,18 @@ async def group_member_increase(login, net, raw):
|
|
|
15
15
|
guild_id = str(data["group_id"])
|
|
16
16
|
guild = Guild(guild_id, avatar=group_avatar(guild_id))
|
|
17
17
|
channel = Channel(guild_id, ChannelType.TEXT)
|
|
18
|
+
if data["user_id"] == raw["self_id"]:
|
|
19
|
+
return Event(
|
|
20
|
+
EventType.GUILD_ADDED,
|
|
21
|
+
datetime.now(),
|
|
22
|
+
login=login,
|
|
23
|
+
user=login.user,
|
|
24
|
+
member=Member(login.user, avatar=user_avatar(data["user_id"]), roles=[Role("member", "群成员")]),
|
|
25
|
+
guild=guild,
|
|
26
|
+
channel=channel,
|
|
27
|
+
)
|
|
18
28
|
user = User(str(data["user_id"]), avatar=user_avatar(data["user_id"]))
|
|
19
|
-
member = Member(user, avatar=user.avatar)
|
|
29
|
+
member = Member(user, avatar=user.avatar, roles=[Role("member", "群成员")])
|
|
20
30
|
operator = None
|
|
21
31
|
if data.get("operator_id"):
|
|
22
32
|
operator = User(str(data["operator_id"]), avatar=user_avatar(data["operator_id"]))
|
|
@@ -38,6 +48,16 @@ async def group_member_decrease(login, net, raw):
|
|
|
38
48
|
guild_id = str(data["group_id"])
|
|
39
49
|
guild = Guild(guild_id, avatar=group_avatar(guild_id))
|
|
40
50
|
channel = Channel(guild_id, ChannelType.TEXT)
|
|
51
|
+
if data["user_id"] == raw["self_id"]:
|
|
52
|
+
return Event(
|
|
53
|
+
EventType.GUILD_REMOVED,
|
|
54
|
+
datetime.now(),
|
|
55
|
+
login=login,
|
|
56
|
+
user=login.user,
|
|
57
|
+
member=Member(login.user, avatar=user_avatar(data["user_id"]), roles=[Role("member", "群成员")]),
|
|
58
|
+
guild=guild,
|
|
59
|
+
channel=channel,
|
|
60
|
+
)
|
|
41
61
|
user = User(str(data["user_id"]), avatar=user_avatar(data["user_id"]))
|
|
42
62
|
member = Member(user, avatar=user.avatar)
|
|
43
63
|
operator = None
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|