1
1
from dataclasses import dataclass
2
2
from typing import Any , Dict , List , Literal , Optional
3
+ from uuid import UUID
3
4
4
5
from pydantic import Field
5
6
10
11
convert_api_attachment_to_domain ,
11
12
)
12
13
from pybotx .models .base_command import (
13
- BaseBotAPIContext ,
14
14
BotAPIBaseCommand ,
15
15
BotAPIBaseSystemEventPayload ,
16
+ BotAPIUserContext ,
16
17
BotCommandBase ,
17
18
)
18
19
from pybotx .models .bot_account import BotAccount
@@ -30,11 +31,17 @@ class EventEdit(BotCommandBase):
30
31
31
32
Attributes:
32
33
body: Updated message body.
34
+ sync_id: Updated message sync id.
35
+ chat_id: Updated message chat id.
36
+ huid: Updated message user huid.
33
37
attachments: Attachments from updated message.
34
38
entities: Entities from updated message.
35
39
"""
36
40
37
41
body : Optional [str ]
42
+ sync_id : UUID
43
+ chat_id : UUID
44
+ huid : UUID
38
45
attachments : List [IncomingAttachment ]
39
46
entities : List [Entity ]
40
47
@@ -48,9 +55,15 @@ class BotAPIEventEditPayload(BotAPIBaseSystemEventPayload):
48
55
data : BotAPIEventEditData
49
56
50
57
58
+ class BotAPIBotContext (BotAPIUserContext ):
59
+ """Bot context."""
60
+
61
+ group_chat_id : UUID
62
+
63
+
51
64
class BotAPIEventEdit (BotAPIBaseCommand ):
52
65
payload : BotAPIEventEditPayload = Field (..., alias = "command" )
53
- sender : BaseBotAPIContext = Field (..., alias = "from" )
66
+ sender : BotAPIBotContext = Field (..., alias = "from" )
54
67
attachments : List [BotAPIAttachment ]
55
68
entities : List [BotAPIEntity ]
56
69
@@ -73,4 +86,7 @@ def to_domain(self, raw_command: Dict[str, Any]) -> EventEdit:
73
86
convert_bot_api_entity_to_domain (api_entity = entity )
74
87
for entity in self .entities
75
88
],
89
+ sync_id = self .sync_id ,
90
+ chat_id = self .sender .group_chat_id ,
91
+ huid = self .sender .user_huid ,
76
92
)
0 commit comments