This repository has been archived by the owner on Sep 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
proto.proto
153 lines (146 loc) · 3.53 KB
/
proto.proto
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
message Actions{
message ToWSApiAction {
message Reply{
required string id = 1;
repeated MessageElement message = 2;
}
message SendToGroup {
required int64 group = 1;
required int64 bot = 2;
repeated MessageElement message = 3;
optional string metadata = 4;
}
message SendToFriend {
required int64 friend = 1;
required int64 bot = 2;
repeated MessageElement message = 3;
optional string metadata = 4;
}
message RecallReceipt {
required string receipt = 1;
optional string metadata = 2;
}
message MuteMember {
required int64 bot = 1;
required int64 group = 2;
required int64 member = 3;
required int32 time = 4;
optional string metadata = 5;
}
message Recall {
required string messageSource = 1;
optional string metadata = 2;
}
}
message FromWSApiAction {
required bool isMessageEvent = 50;
message ActionResult {
// only mark
// false forever
required bool isMessageEvent = 50 [default = false];
message ResultSuccess {
optional string metadata = 1;
// nullable
map<string, string> extendData = 2;
}
message ResultFailed {
optional string metadata = 1;
required string error = 2;
required string fullError = 3;
}
}
message Events {
// only mark
// true forever
required bool isMessageEvent = 50 [default = true];
message MessageEvent {
// The key for reply
required string replyKey = 53;
message GroupMessage {
required Group group = 1;
required Member sender = 2;
required string replyKey = 3;
required int64 bot = 4;
}
message TempMessage {
required Group group = 1;
required Member sender = 2;
required string replyKey = 3;
required int64 bot = 4;
}
message FriendMessage {
required Friend sender = 2;
required string replyKey = 3;
required int64 bot = 4;
}
}
}
}
}
message MessageElement {
message AtAll {
// No any field
}
message PlainText {
required string msg = 1;
}
message At {
required int64 target = 1;
optional string display = 2;
}
message Face {
required int32 id = 1;
}
message Image {
optional string id = 1;
optional string url = 2;
}
message FlashImage {
required Image image = 1;
}
message MessageSource {
required string id = 1;
}
message Poke {
optional string name = 1;
required int32 pokeType = 2;
}
message Voice {
optional string url = 1;
required string filename = 2;
}
message Quote {
// Message Source id
required string id = 1;
}
message Service {
required int32 id = 1;
required string content = 2;
}
message LightApp {
required string content = 1;
}
}
// contact
message Friend {
required int64 id = 1;
required string nick = 2;
}
enum MemberPermission {
member = 0;
administrator = 1;
owner = 2;
}
message Member {
required int64 id = 1;
required string nick = 2;
required string nameCard = 3;
required string nameCardOrNick = 4;
required MemberPermission permission = 5;
required string specialTitle = 6;
}
message Group {
required int64 id = 1;
required string name = 2;
required MemberPermission botPermission = 3;
}