-
Notifications
You must be signed in to change notification settings - Fork 2
/
onebot_api.proto
445 lines (386 loc) · 7.79 KB
/
onebot_api.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
syntax = "proto3";
package onebot;
import "onebot_base.proto";
message SendPrivateMsgReq{
int64 user_id = 1;
repeated Message message = 2;
bool auto_escape = 3;
}
message SendPrivateMsgResp{
int32 message_id = 1; // 兼容旧版GMC
MessageReceipt message_receipt = 2;
}
message SendGroupMsgReq{
int64 group_id = 1;
repeated Message message = 2;
bool auto_escape = 3;
}
message SendGroupMsgResp{
int32 message_id = 1; // 兼容旧版GMC
MessageReceipt message_receipt = 2;
}
message SendChannelMsgReq{
uint64 guild_id = 1;
uint64 channel_id = 2;
repeated Message message = 3;
bool auto_escape = 4;
}
message SendChannelMsgResp{
uint64 message_id = 1;
}
message SendMsgReq{
string message_type = 1;
int64 user_id = 2;
int64 group_id = 3;
repeated Message message = 4;
bool auto_escape = 5;
}
message SendMsgResp{
int32 message_id = 1; // 兼容旧版GMC
MessageReceipt message_receipt = 2;
}
message DeleteMsgReq{
int32 message_id = 1; // 兼容旧版GMC
MessageReceipt message_receipt = 2;
}
message DeleteMsgResp{
}
message GetMsgReq{
int32 message_id = 1;
}
message GetMsgResp{
int32 time = 1;
string message_type = 2;
int32 message_id = 3;
int32 real_id = 4;
Sender sender = 5;
repeated Message message = 6;
string raw_message = 7;
message Sender{
int64 user_id = 1;
string nickname = 2;
string card = 3;
string sex = 4;
int32 age = 5;
string area = 6;
string level = 7;
string role = 8;
string title = 9;
}
}
// TODO 暂时不支持
message GetForwardMsgReq{
string id = 1;
}
message GetForwardMsgResp{
}
message SendLikeReq{
int64 user_id = 1;
int32 times = 2;
}
message SendLikeResp{
}
message SetGroupKickReq{
int64 group_id = 1;
int64 user_id = 2;
bool reject_add_request = 3;
repeated int64 user_ids = 4;
}
message SetGroupKickResp{
}
message SetGroupBanReq{
int64 group_id = 1;
int64 user_id = 2;
int32 duration = 3;
}
message SetGroupBanResp{
}
message SetGroupAnonymousBanReq{
int64 group_id = 1;
Anonymous anonymous = 2;
string anonymous_flag = 3;
string flag = 4;
int64 duration = 5;
message Anonymous{
int64 id = 1;
string name = 2;
string flag = 3;
}
}
message SetGroupAnonymousBanResp{
}
message SetGroupWholeBanReq{
int64 group_id = 1;
bool enable = 2;
}
message SetGroupWholeBanResp{
}
message SetGroupAdminReq{
int64 group_id = 1;
int64 user_id = 2;
bool enable = 3;
}
message SetGroupAdminResp{
}
message SetGroupAnonymousReq{
int64 group_id = 1;
bool enable = 2;
}
message SetGroupAnonymousResp{
}
message SetGroupCardReq{
int64 group_id = 1;
int64 user_id = 2;
string card = 3;
}
message SetGroupCardResp{
}
message SetGroupNameReq{
int64 group_id = 1;
string group_name = 2;
}
message SetGroupNameResp{
}
message SetGroupLeaveReq{
int64 group_id = 1;
bool is_dismiss = 2;
}
message SetGroupLeaveResp{
}
message SetGroupSpecialTitleReq{
int64 group_id = 1;
int64 user_id = 2;
string special_title = 3;
int64 duration = 4;
}
message SetGroupSpecialTitleResp{
}
message SetFriendAddRequestReq{
string flag = 1;
bool approve = 2;
string remark = 3;
}
message SetFriendAddRequestResp{
}
message SetGroupAddRequestReq{
string flag = 1;
string sub_type = 2;
string type = 3;
bool approve = 4;
string reason = 5;
}
message SetGroupAddRequestResp{
}
message GetLoginInfoReq{
}
message GetLoginInfoResp{
int64 user_id = 1;
string nickname = 2;
}
message GetStrangerInfoReq{
int64 user_id = 1;
bool no_cache = 2;
}
message GetStrangerInfoResp{
int64 user_id = 1;
string nickname = 2;
string sex = 3;
int32 age = 4;
int32 level = 5; // 扩展
int64 login_days = 6; // 扩展
}
message GetFriendListReq{
}
message GetFriendListResp{
repeated Friend friend = 1;
message Friend{
int64 user_id = 1;
string nickname = 2;
string remark = 3;
}
}
message GetGroupInfoReq{
int64 group_id = 1;
bool no_cache = 2;
}
message GetGroupInfoResp{
int64 group_id = 1;
string group_name = 2;
int32 member_count = 3;
int32 max_member_count = 4;
}
message GetGroupListReq{
}
message GetGroupListResp{
repeated Group group = 1;
message Group{
int64 group_id = 1;
string group_name = 2;
int32 member_count = 3;
int32 max_member_count = 4;
}
}
message GetGroupMemberInfoReq{
int64 group_id = 1;
int64 user_id = 2;
bool no_cache = 3;
}
message GetGroupMemberInfoResp{
int64 group_id = 1;
int64 user_id = 2;
string nickname = 3;
string card = 4;
string sex = 5;
int32 age = 6;
string area = 7;
int64 join_time = 8;
int64 last_sent_time = 9;
string level = 10;
string role = 11;
bool unfriendly = 12;
string title = 13;
int64 title_expire_time = 14;
bool card_changeable = 15;
}
message GetGroupMemberListReq{
int64 group_id = 1;
}
message GetGroupMemberListResp{
repeated GroupMember group_member = 1;
message GroupMember{
int64 group_id = 1;
int64 user_id = 2;
string nickname = 3;
string card = 4;
string sex = 5;
int32 age = 6;
string area = 7;
int64 join_time = 8;
int64 last_sent_time = 9;
string level = 10;
string role = 11;
bool unfriendly = 12;
string title = 13;
int64 title_expire_time = 14;
bool card_changeable = 15;
}
}
message GetGroupHonorInfoReq{
int64 group_id = 1;
string type = 2;
}
message GetGroupHonorInfoResp{
int64 group_id = 1;
CurrentTalkative current_talkative = 2;
repeated Honor talkative = 3;
repeated Honor performer = 4;
repeated Honor legend = 5;
repeated Honor strong_newbie = 6;
repeated Honor emotion = 7;
message CurrentTalkative{
int64 user_id = 1;
string nickname = 2;
string avatar = 3;
int32 day_count = 4;
}
message Honor{
int64 user_id = 1;
string nickname = 2;
string avatar = 3;
string description = 4;
}
}
message GetCookiesReq{
string domain = 1;
}
message GetCookiesResp{
string cookies = 1;
}
message GetCsrfTokenReq{
}
message GetCsrfTokenResp{
int32 token = 1;
}
message GetCredentialsReq{
string domain = 1;
}
message GetCredentialsResp{
string cookies = 1;
int32 csrf_token = 2;
}
message GetRecordReq{
string file = 1;
string out_format = 2;
}
message GetRecordResp{
string file = 1;
}
message GetImageReq{
string file = 1;
}
message GetImageResp{
string file = 1;
}
message CanSendImageReq{
}
message CanSendImageResp{
bool yes = 1;
}
message CanSendRecordReq{
}
message CanSendRecordResp{
bool yes = 1;
}
message GetStatusReq{
}
message GetStatusResp{
bool online = 1;
bool good = 2;
}
message GetVersionInfoReq{
}
message GetVersionInfoResp{
string app_name = 1;
string app_version = 2;
string protocol_version = 3;
map<string, string> extra = 4;
}
message SetRestartReq{
int32 delay = 1;
}
message SetRestartResp{
}
message CleanCacheReq{
}
message CleanCacheResp{
}
message SetGroupSignInReq{
int64 group_id = 1;
}
message SetGroupSignInResp{
}
message SendMusicReq{
int64 group_id = 1;
int64 user_id = 2;
string type = 3;
string title = 4;
string brief = 5;
string summary = 6;
string url = 7;
string picture_url = 8;
string music_url = 9;
}
message SendMusicResp{
}
message SendGroupPokeReq{
int64 to_uin = 1;
int64 group_id = 2;
}
message SendGroupPokeResp{
}
message SendFriendPokeReq{
int64 to_uin = 1;
int64 aio_uin = 2;
}
message SendFriendPokeResp{
}