This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcommon.py
94 lines (74 loc) · 1.67 KB
/
common.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
from typing import Optional, List, TYPE_CHECKING
from dataclasses import dataclass, field
from cai.pb.msf.msg.comm import Msg
from .base import Event, BotEvent
if TYPE_CHECKING:
from ..message_service.models import Element
from ..status_service.jce import InstanceInfo
@dataclass
class NudgeEvent(Event):
sender: int
target: int
action: str
suffix: Optional[str]
group: Optional[int] = None
@property
def type(self) -> str:
return "NudgeEvent"
@dataclass
class BotOnlineEvent(BotEvent):
qq: int
@dataclass
class BotOfflineEvent(BotEvent):
qq: int
reconnect: bool
@dataclass
class OtherClientChangedEvent(BotEvent):
is_login: bool
app_id: int
client_type: int
platform: int
title: str
description: str
instance_list: List["InstanceInfo"]
@dataclass
class PrivateMessage(Event):
seq: int
time: int
auto_reply: bool
from_uin: int
from_nick: str
to_uin: int
message: List["Element"]
_msg: Msg = field(repr=False)
@property
def type(self) -> str:
return "private_message"
@dataclass
class GroupMessage(Event):
seq: int
rand: int
time: int
group_id: int
group_name: str
group_level: int
from_uin: int
from_group_card: str
message: List["Element"]
_msg: Msg = field(repr=False)
@property
def type(self) -> str:
return "group_message"
@dataclass
class TempMessage(Event):
seq: int
rand: int
time: int
group_id: int
from_uin: int
from_group_card: str
message: List["Element"]
_msg: Msg = field(repr=False)
@property
def type(self) -> str:
return "temp_message"