onebot 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: fd15a2971169fff7ef28439ac0a0cebb62783098bb76ca57d5f81810eec061fc
4
+ data.tar.gz: 2547e196582cf03fcab6c106743810571aecc9a9db0bb87e175533dcaceedf8c
5
+ SHA512:
6
+ metadata.gz: a9e35d322bc8440670eb31ca35502484e160bb9aa42b5d1c8eaf626051603051fb751f3238a461f2108d28f8f7ce082685fe6bbb349de159f250ce83022cff92
7
+ data.tar.gz: 1fe3954baa3d2bb86719324f1f8e5e74cde84bba2520179f03f9fa91f0ebca73392fa3aca56f6bd132a523e3de854a60fe4858ae1ed05ebd4b5837ba99ef9793
@@ -0,0 +1,18 @@
1
+ name: Ruby
2
+
3
+ on: [push,pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v2
10
+ - name: Set up Ruby
11
+ uses: ruby/setup-ruby@v1
12
+ with:
13
+ ruby-version: 3.0.0
14
+ - name: Run the default task
15
+ run: |
16
+ gem install bundler -v 2.2.4
17
+ bundle install
18
+ bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,10 @@
1
+ Style/StringLiterals:
2
+ Enabled: true
3
+ EnforcedStyle: double_quotes
4
+
5
+ Style/StringLiteralsInInterpolation:
6
+ Enabled: true
7
+ EnforcedStyle: double_quotes
8
+
9
+ Layout/LineLength:
10
+ Max: 120
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in onebot.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 0.80"
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Jiting
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # Onebot
2
+
3
+ A ruby onebot client based on (go-cqhttp version) onebot protocol.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'onebot'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle install
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install onebot
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ```ruby
26
+ client = Onebot::Client.new
27
+ client.get_status
28
+ client.send_message(user_id: QQ_NUMBER, message: "ping")
29
+ ```
30
+
31
+ ## Development
32
+
33
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
34
+
35
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
36
+
37
+ ## Contributing
38
+
39
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jitingcn/onebot-rb.
40
+
41
+ ## License
42
+
43
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "onebot"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/fetch-methods ADDED
@@ -0,0 +1,107 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Fetch list of methods from go-cqhttp docs.
4
+
5
+ require 'json'
6
+ require 'open-uri'
7
+
8
+ class API
9
+ attr_reader :api_docs_url
10
+ attr_accessor :functions, :current_title, :current_endpoint, :current_params, :current_response, :others
11
+
12
+ def initialize(api_docs_url='https://raw.githubusercontent.com/ishkong/go-cqhttp-docs/main/docs/api/README.md')
13
+ @api_docs_url = api_docs_url.freeze
14
+ @functions = {}
15
+ @current_params = {}
16
+ @current_response = {}
17
+ @others = {}
18
+ parse_doc
19
+ @functions.freeze
20
+ end
21
+
22
+ def parse_table(table, type)
23
+ output = {}
24
+ table = table.split("\n").select { |i| i[0] == "|" }
25
+ head = table[0].split('|').map(&:strip)[1..]
26
+ head.map! do |i|
27
+ case i
28
+ when /字段/
29
+ i = "name"
30
+ when /类型/
31
+ i = "type"
32
+ when /默认/
33
+ i = "default"
34
+ when /说明/
35
+ i = "description"
36
+ else
37
+ nil
38
+ end
39
+ i
40
+ end
41
+
42
+ data = table[2..].map do |line|
43
+ line.split('|').map do |row|
44
+ row.strip.delete('`')
45
+ end[1..]
46
+ end
47
+
48
+ data.each do |row|
49
+ if row[0].include? "或"
50
+ row[0] = row[0].split("或")[0].delete(" ")
51
+ end
52
+ output[row[0]] = {}
53
+ row.size.times do |i|
54
+ next if head[i] == "name"
55
+ output[row[0]].merge!({ "#{head[i]}": row[i] })
56
+ end
57
+ end
58
+
59
+ instance_variable_set(type, output)
60
+ rescue NoMethodError
61
+ instance_variable_set(type, "error")
62
+ end
63
+
64
+ def parse_doc
65
+ URI.parse(@api_docs_url).open&.read&.split("## ")[1..].each do |data|
66
+ zone = data.split("\n\n")
67
+ @current_title = zone[0]
68
+ zone.each_with_index do |line, index|
69
+ if line =~ /^终结点/
70
+ @current_endpoint = line.gsub(/终结点.+`\/(.+)`/, '\1')
71
+ end
72
+
73
+ if line =~ /^\*\*(.+)\*\*/ # match **text**
74
+ type = line.gsub(/\*\*(.+)\*\*/, '\1')
75
+ case type
76
+ when "参数"
77
+ parse_table zone[index+1], :@current_params if index+1 <= zone.size-1
78
+ when "响应数据"
79
+ parse_table zone[index+1], :@current_response if index+1 <= zone.size-1
80
+ else
81
+ parse_table zone[index+1], :@others if index+1 <= zone.size-1
82
+ end
83
+ end
84
+ end
85
+ add_function
86
+ cleanup
87
+ end
88
+ end
89
+
90
+ def add_function
91
+ if @current_endpoint
92
+ functions[@current_endpoint] = { title: @current_title, params: @current_params.empty? ? nil : @current_params,
93
+ response: @current_response.empty? ? nil : @current_response }
94
+ functions[@current_endpoint].merge!({ others: @others }) unless @others.empty?
95
+ end
96
+ end
97
+
98
+ def cleanup
99
+ @current_title = nil
100
+ @current_endpoint = nil
101
+ @current_params = {}
102
+ @current_response = {}
103
+ @others = {}
104
+ end
105
+ end
106
+
107
+ puts API.new.functions.then(&JSON.method(:pretty_generate))
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/lib/onebot.rb ADDED
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "onebot/version"
4
+
5
+ module Onebot
6
+ class Error < StandardError; end
7
+
8
+ # Raised for valid response with 403 status code.
9
+ class Forbidden < Error; end
10
+
11
+ # Raised for valid response with 404 status code.
12
+ class NotFound < Error; end
13
+
14
+ autoload :Client, "onebot/client"
15
+ end
@@ -0,0 +1,25 @@
1
+ require "json"
2
+ require "excon"
3
+
4
+ module Onebot
5
+ class Client
6
+ require_relative "client/api_helper"
7
+ include ApiHelper
8
+
9
+ attr_reader :client, :server
10
+
11
+ def initialize(host, token = nil, **options)
12
+ @server = host || "http://localhost:5700"
13
+ @token = token || options[:token]
14
+ Excon.defaults[:headers].merge({"Authorization" => "Bearer #{@token}"}) if @token
15
+ @client = Excon.new(@server)
16
+ end
17
+
18
+ def request(action, body = {})
19
+ pp body
20
+ response = client.get(path: action, query: body)
21
+ # raise self.class.error_for_response(response) if response.status >= 300
22
+ JSON.parse(response.body)
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,1322 @@
1
+ {
2
+ "send_private_msg": {
3
+ "title": "发送私聊消息",
4
+ "params": {
5
+ "user_id": {
6
+ "type": "int64",
7
+ "default": "-",
8
+ "description": "对方 QQ 号"
9
+ },
10
+ "message": {
11
+ "type": "message",
12
+ "default": "-",
13
+ "description": "要发送的内容"
14
+ },
15
+ "auto_escape": {
16
+ "type": "boolean",
17
+ "default": "false",
18
+ "description": "消息内容是否作为纯文本发送 ( 即不解析 CQ 码 ) , 只在 message 字段是字符串时有效"
19
+ }
20
+ },
21
+ "response": {
22
+ "message_id": {
23
+ "type": "int32",
24
+ "description": "消息 ID"
25
+ }
26
+ }
27
+ },
28
+ "send_group_msg": {
29
+ "title": " 发送群消息",
30
+ "params": {
31
+ "group_id": {
32
+ "type": "int64",
33
+ "default": "-",
34
+ "description": "群号"
35
+ },
36
+ "message": {
37
+ "type": "message",
38
+ "default": "-",
39
+ "description": "要发送的内容"
40
+ },
41
+ "auto_escape": {
42
+ "type": "boolean",
43
+ "default": "false",
44
+ "description": "消息内容是否作为纯文本发送 ( 即不解析 CQ 码) , 只在 message 字段是字符串时有效"
45
+ }
46
+ },
47
+ "response": {
48
+ "message_id": {
49
+ "type": "int32",
50
+ "description": "消息 ID"
51
+ }
52
+ }
53
+ },
54
+ "send_group_forward_msg": {
55
+ "title": "发送合并转发 ( 群 )",
56
+ "params": {
57
+ "group_id": {
58
+ "type": "int64",
59
+ "description": "群号"
60
+ },
61
+ "messages": {
62
+ "type": "forward node[]",
63
+ "description": "自定义转发消息, 具体看 CQcode"
64
+ }
65
+ },
66
+ "response": null
67
+ },
68
+ "send_msg": {
69
+ "title": "发送消息",
70
+ "params": {
71
+ "message_type": {
72
+ "type": "string",
73
+ "default": "-",
74
+ "description": "消息类型, 支持 private、group , 分别对应私聊、群组, 如不传入, 则根据传入的 *_id 参数判断"
75
+ },
76
+ "user_id": {
77
+ "type": "int64",
78
+ "default": "-",
79
+ "description": "对方 QQ 号 ( 消息类型为 private 时需要 )"
80
+ },
81
+ "group_id": {
82
+ "type": "int64",
83
+ "default": "-",
84
+ "description": "群号 ( 消息类型为 group 时需要 )"
85
+ },
86
+ "message": {
87
+ "type": "message",
88
+ "default": "-",
89
+ "description": "要发送的内容"
90
+ },
91
+ "auto_escape": {
92
+ "type": "boolean",
93
+ "default": "false",
94
+ "description": "消息内容是否作为纯文本发送 ( 即不解析 CQ 码 ) , 只在 message 字段是字符串时有效"
95
+ }
96
+ },
97
+ "response": {
98
+ "message_id": {
99
+ "type": "int32",
100
+ "description": "消息 ID"
101
+ }
102
+ }
103
+ },
104
+ "delete_msg": {
105
+ "title": "撤回消息",
106
+ "params": {
107
+ "message_id": {
108
+ "type": "int32",
109
+ "default": "-",
110
+ "description": "消息 ID"
111
+ }
112
+ },
113
+ "response": null
114
+ },
115
+ "get_msg": {
116
+ "title": "获取消息",
117
+ "params": {
118
+ "message_id": {
119
+ "type": "int32",
120
+ "description": "消息id"
121
+ }
122
+ },
123
+ "response": {
124
+ "message_id": {
125
+ "type": "int32",
126
+ "description": "消息id"
127
+ },
128
+ "real_id": {
129
+ "type": "int32",
130
+ "description": "消息真实id"
131
+ },
132
+ "sender": {
133
+ "type": "object",
134
+ "description": "发送者"
135
+ },
136
+ "time": {
137
+ "type": "int32",
138
+ "description": "发送时间"
139
+ },
140
+ "message": {
141
+ "type": "message",
142
+ "description": "消息内容"
143
+ },
144
+ "raw_message": {
145
+ "type": "message",
146
+ "description": "原始消息内容"
147
+ }
148
+ }
149
+ },
150
+ "get_forward_msg": {
151
+ "title": "获取合并转发内容",
152
+ "params": {
153
+ "message_id": {
154
+ "type": "string",
155
+ "description": "消息id"
156
+ }
157
+ },
158
+ "response": {
159
+ "messages": {
160
+ "type": "forward message[]",
161
+ "description": "消息列表"
162
+ }
163
+ }
164
+ },
165
+ "get_image": {
166
+ "title": "获取图片信息",
167
+ "params": {
168
+ "file": {
169
+ "type": "string",
170
+ "description": "图片缓存文件名"
171
+ }
172
+ },
173
+ "response": {
174
+ "size": {
175
+ "type": "int32",
176
+ "description": "图片源文件大小"
177
+ },
178
+ "filename": {
179
+ "type": "string",
180
+ "description": "图片文件原名"
181
+ },
182
+ "url": {
183
+ "type": "string",
184
+ "description": "图片下载地址"
185
+ }
186
+ }
187
+ },
188
+ "set_group_kick": {
189
+ "title": "群组踢人",
190
+ "params": {
191
+ "group_id": {
192
+ "type": "int64",
193
+ "default": "-",
194
+ "description": "群号"
195
+ },
196
+ "user_id": {
197
+ "type": "int64",
198
+ "default": "-",
199
+ "description": "要踢的 QQ 号"
200
+ },
201
+ "reject_add_request": {
202
+ "type": "boolean",
203
+ "default": "false",
204
+ "description": "拒绝此人的加群请求"
205
+ }
206
+ },
207
+ "response": null
208
+ },
209
+ "set_group_ban": {
210
+ "title": "群组单人禁言",
211
+ "params": {
212
+ "group_id": {
213
+ "type": "int64",
214
+ "default": "-",
215
+ "description": "群号"
216
+ },
217
+ "user_id": {
218
+ "type": "int64",
219
+ "default": "-",
220
+ "description": "要禁言的 QQ 号"
221
+ },
222
+ "duration": {
223
+ "type": "number",
224
+ "default": "30 * 60",
225
+ "description": "禁言时长, 单位秒, 0 表示取消禁言"
226
+ }
227
+ },
228
+ "response": null
229
+ },
230
+ "set_group_anonymous_ban": {
231
+ "title": "群组匿名用户禁言",
232
+ "params": {
233
+ "group_id": {
234
+ "type": "int64",
235
+ "default": "-",
236
+ "description": "群号"
237
+ },
238
+ "anonymous": {
239
+ "type": "object",
240
+ "default": "-",
241
+ "description": "可选, 要禁言的匿名用户对象(群消息上报的 anonymous 字段)"
242
+ },
243
+ "anonymous_flag": {
244
+ "type": "string",
245
+ "default": "-",
246
+ "description": "可选, 要禁言的匿名用户的 flag(需从群消息上报的数据中获得)"
247
+ },
248
+ "duration": {
249
+ "type": "number",
250
+ "default": "30 * 60",
251
+ "description": "禁言时长, 单位秒, 无法取消匿名用户禁言"
252
+ }
253
+ },
254
+ "response": null
255
+ },
256
+ "set_group_whole_ban": {
257
+ "title": "群组全员禁言",
258
+ "params": {
259
+ "group_id": {
260
+ "type": "int64",
261
+ "default": "-",
262
+ "description": "群号"
263
+ },
264
+ "enable": {
265
+ "type": "boolean",
266
+ "default": "true",
267
+ "description": "是否禁言"
268
+ }
269
+ },
270
+ "response": null
271
+ },
272
+ "set_group_admin": {
273
+ "title": "群组设置管理员",
274
+ "params": {
275
+ "group_id": {
276
+ "type": "int64",
277
+ "default": "-",
278
+ "description": "群号"
279
+ },
280
+ "user_id": {
281
+ "type": "int64",
282
+ "default": "-",
283
+ "description": "要设置管理员的 QQ 号"
284
+ },
285
+ "enable": {
286
+ "type": "boolean",
287
+ "default": "true",
288
+ "description": "true 为设置, false 为取消"
289
+ }
290
+ },
291
+ "response": null
292
+ },
293
+ "set_group_anonymous": {
294
+ "title": "群组匿名",
295
+ "params": {
296
+ "group_id": {
297
+ "type": "int64",
298
+ "default": "-",
299
+ "description": "群号"
300
+ },
301
+ "enable": {
302
+ "type": "boolean",
303
+ "default": "true",
304
+ "description": "是否允许匿名聊天"
305
+ }
306
+ },
307
+ "response": null
308
+ },
309
+ "set_group_card": {
310
+ "title": "设置群名片 ( 群备注 )",
311
+ "params": {
312
+ "group_id": {
313
+ "type": "int64",
314
+ "default": "-",
315
+ "description": "群号"
316
+ },
317
+ "user_id": {
318
+ "type": "int64",
319
+ "default": "-",
320
+ "description": "要设置的 QQ 号"
321
+ },
322
+ "card": {
323
+ "type": "string",
324
+ "default": "空",
325
+ "description": "群名片内容, 不填或空字符串表示删除群名片"
326
+ }
327
+ },
328
+ "response": null
329
+ },
330
+ "set_group_name": {
331
+ "title": "设置群名",
332
+ "params": {
333
+ "group_id": {
334
+ "type": "int64",
335
+ "description": "群号"
336
+ },
337
+ "group_name": {
338
+ "type": "string",
339
+ "description": "新群名"
340
+ }
341
+ },
342
+ "response": null
343
+ },
344
+ "set_group_leave": {
345
+ "title": "退出群组",
346
+ "params": {
347
+ "group_id": {
348
+ "type": "int64",
349
+ "default": "-",
350
+ "description": "群号"
351
+ },
352
+ "is_dismiss": {
353
+ "type": "boolean",
354
+ "default": "false",
355
+ "description": "是否解散, 如果登录号是群主, 则仅在此项为 true 时能够解散"
356
+ }
357
+ },
358
+ "response": null
359
+ },
360
+ "set_group_special_title": {
361
+ "title": "设置群组专属头衔",
362
+ "params": {
363
+ "group_id": {
364
+ "type": "int64",
365
+ "default": "-",
366
+ "description": "群号"
367
+ },
368
+ "user_id": {
369
+ "type": "int64",
370
+ "default": "-",
371
+ "description": "要设置的 QQ 号"
372
+ },
373
+ "special_title": {
374
+ "type": "string",
375
+ "default": "空",
376
+ "description": "专属头衔, 不填或空字符串表示删除专属头衔"
377
+ },
378
+ "duration": {
379
+ "type": "number",
380
+ "default": "-1",
381
+ "description": "专属头衔有效期, 单位秒, -1 表示永久, 不过此项似乎没有效果, 可能是只有某些特殊的时间长度有效, 有待测试"
382
+ }
383
+ },
384
+ "response": null
385
+ },
386
+ "set_friend_add_request": {
387
+ "title": "处理加好友请求",
388
+ "params": {
389
+ "flag": {
390
+ "type": "string",
391
+ "default": "-",
392
+ "description": "加好友请求的 flag(需从上报的数据中获得)"
393
+ },
394
+ "approve": {
395
+ "type": "boolean",
396
+ "default": "true",
397
+ "description": "是否同意请求"
398
+ },
399
+ "remark": {
400
+ "type": "string",
401
+ "default": "空",
402
+ "description": "添加后的好友备注(仅在同意时有效)"
403
+ }
404
+ },
405
+ "response": null
406
+ },
407
+ "set_group_add_request": {
408
+ "title": "处理加群请求/邀请",
409
+ "params": {
410
+ "flag": {
411
+ "type": "string",
412
+ "default": "-",
413
+ "description": "加群请求的 flag(需从上报的数据中获得)"
414
+ },
415
+ "sub_type": {
416
+ "type": "string",
417
+ "default": "-",
418
+ "description": "add 或 invite, 请求类型(需要和上报消息中的 sub_type 字段相符)"
419
+ },
420
+ "approve": {
421
+ "type": "boolean",
422
+ "default": "true",
423
+ "description": "是否同意请求/邀请"
424
+ },
425
+ "reason": {
426
+ "type": "string",
427
+ "default": "空",
428
+ "description": "拒绝理由(仅在拒绝时有效)"
429
+ }
430
+ },
431
+ "response": null
432
+ },
433
+ "get_login_info": {
434
+ "title": "获取登录号信息",
435
+ "params": null,
436
+ "response": {
437
+ "user_id": {
438
+ "type": "int64",
439
+ "description": "QQ 号"
440
+ },
441
+ "nickname": {
442
+ "type": "string",
443
+ "description": "QQ 昵称"
444
+ }
445
+ }
446
+ },
447
+ "get_stranger_info": {
448
+ "title": "获取陌生人信息",
449
+ "params": {
450
+ "user_id": {
451
+ "type": "int64",
452
+ "default": "-",
453
+ "description": "QQ 号"
454
+ },
455
+ "no_cache": {
456
+ "type": "boolean",
457
+ "default": "false",
458
+ "description": "是否不使用缓存(使用缓存可能更新不及时, 但响应更快)"
459
+ }
460
+ },
461
+ "response": {
462
+ "user_id": {
463
+ "type": "int64",
464
+ "description": "QQ 号"
465
+ },
466
+ "nickname": {
467
+ "type": "string",
468
+ "description": "昵称"
469
+ },
470
+ "sex": {
471
+ "type": "string",
472
+ "description": "性别, male 或 female 或 unknown"
473
+ },
474
+ "age": {
475
+ "type": "int32",
476
+ "description": "年龄"
477
+ },
478
+ "qid": {
479
+ "type": "string",
480
+ "description": "qid ID身份卡"
481
+ }
482
+ }
483
+ },
484
+ "get_friend_list": {
485
+ "title": "获取好友列表",
486
+ "params": null,
487
+ "response": "error"
488
+ },
489
+ "get_group_info": {
490
+ "title": "获取群信息",
491
+ "params": {
492
+ "group_id": {
493
+ "type": "int64",
494
+ "default": "-",
495
+ "description": "群号"
496
+ },
497
+ "no_cache": {
498
+ "type": "boolean",
499
+ "default": "false",
500
+ "description": "是否不使用缓存(使用缓存可能更新不及时, 但响应更快)"
501
+ }
502
+ },
503
+ "response": {
504
+ "group_id": {
505
+ "type": "int64",
506
+ "description": "群号"
507
+ },
508
+ "group_name": {
509
+ "type": "string",
510
+ "description": "群名称"
511
+ },
512
+ "member_count": {
513
+ "type": "int32",
514
+ "description": "成员数"
515
+ },
516
+ "max_member_count": {
517
+ "type": "int32",
518
+ "description": "最大成员数(群容量)"
519
+ }
520
+ }
521
+ },
522
+ "get_group_list": {
523
+ "title": "获取群列表",
524
+ "params": null,
525
+ "response": "error"
526
+ },
527
+ "get_group_member_info": {
528
+ "title": "获取群成员信息",
529
+ "params": {
530
+ "group_id": {
531
+ "type": "int64",
532
+ "default": "-",
533
+ "description": "群号"
534
+ },
535
+ "user_id": {
536
+ "type": "int64",
537
+ "default": "-",
538
+ "description": "QQ 号"
539
+ },
540
+ "no_cache": {
541
+ "type": "boolean",
542
+ "default": "false",
543
+ "description": "是否不使用缓存(使用缓存可能更新不及时, 但响应更快)"
544
+ }
545
+ },
546
+ "response": {
547
+ "group_id": {
548
+ "type": "int64",
549
+ "description": "群号"
550
+ },
551
+ "user_id": {
552
+ "type": "int64",
553
+ "description": "QQ 号"
554
+ },
555
+ "nickname": {
556
+ "type": "string",
557
+ "description": "昵称"
558
+ },
559
+ "card": {
560
+ "type": "string",
561
+ "description": "群名片/备注"
562
+ },
563
+ "sex": {
564
+ "type": "string",
565
+ "description": "性别, male 或 female 或 unknown"
566
+ },
567
+ "age": {
568
+ "type": "int32",
569
+ "description": "年龄"
570
+ },
571
+ "area": {
572
+ "type": "string",
573
+ "description": "地区"
574
+ },
575
+ "join_time": {
576
+ "type": "int32",
577
+ "description": "加群时间戳"
578
+ },
579
+ "last_sent_time": {
580
+ "type": "int32",
581
+ "description": "最后发言时间戳"
582
+ },
583
+ "level": {
584
+ "type": "string",
585
+ "description": "成员等级"
586
+ },
587
+ "role": {
588
+ "type": "string",
589
+ "description": "角色, owner 或 admin 或 member"
590
+ },
591
+ "unfriendly": {
592
+ "type": "boolean",
593
+ "description": "是否不良记录成员"
594
+ },
595
+ "title": {
596
+ "type": "string",
597
+ "description": "专属头衔"
598
+ },
599
+ "title_expire_time": {
600
+ "type": "int64",
601
+ "description": "专属头衔过期时间戳"
602
+ },
603
+ "card_changeable": {
604
+ "type": "boolean",
605
+ "description": "是否允许修改群名片"
606
+ }
607
+ }
608
+ },
609
+ "get_group_member_list": {
610
+ "title": "获取群成员列表",
611
+ "params": {
612
+ "group_id": {
613
+ "type": "int64",
614
+ "default": "-",
615
+ "description": "群号"
616
+ }
617
+ },
618
+ "response": "error"
619
+ },
620
+ "get_group_honor_info": {
621
+ "title": "获取群荣誉信息",
622
+ "params": {
623
+ "group_id": {
624
+ "type": "int64",
625
+ "default": "-",
626
+ "description": "群号"
627
+ },
628
+ "type": {
629
+ "type": "string",
630
+ "default": "-",
631
+ "description": "要获取的群荣誉类型, 可传入 talkative performer legend strong_newbie emotion 以分别获取单个类型的群荣誉数据, 或传入 all 获取所有数据"
632
+ }
633
+ },
634
+ "response": {
635
+ "group_id": {
636
+ "type": "int64",
637
+ "description": "群号"
638
+ },
639
+ "current_talkative": {
640
+ "type": "object",
641
+ "description": "当前龙王, 仅 type 为 talkative 或 all 时有数据"
642
+ },
643
+ "talkative_list": {
644
+ "type": "array",
645
+ "description": "历史龙王, 仅 type 为 talkative 或 all 时有数据"
646
+ },
647
+ "performer_list": {
648
+ "type": "array",
649
+ "description": "群聊之火, 仅 type 为 performer 或 all 时有数据"
650
+ },
651
+ "legend_list": {
652
+ "type": "array",
653
+ "description": "群聊炽焰, 仅 type 为 legend 或 all 时有数据"
654
+ },
655
+ "strong_newbie_list": {
656
+ "type": "array",
657
+ "description": "冒尖小春笋, 仅 type 为 strong_newbie 或 all 时有数据"
658
+ },
659
+ "emotion_list": {
660
+ "type": "array",
661
+ "description": "快乐之源, 仅 type 为 emotion 或 all 时有数据"
662
+ }
663
+ }
664
+ },
665
+ "get_cookies": {
666
+ "title": "获取 Cookies",
667
+ "params": {
668
+ "domain": {
669
+ "type": "string",
670
+ "default": "空",
671
+ "description": "需要获取 cookies 的域名"
672
+ }
673
+ },
674
+ "response": {
675
+ "cookies": {
676
+ "type": "string",
677
+ "description": "Cookies"
678
+ }
679
+ }
680
+ },
681
+ "get_csrf_token": {
682
+ "title": "获取 CSRF Token",
683
+ "params": null,
684
+ "response": {
685
+ "token": {
686
+ "type": "int32",
687
+ "description": "CSRF Token"
688
+ }
689
+ }
690
+ },
691
+ "get_credentials": {
692
+ "title": "获取 QQ 相关接口凭证",
693
+ "params": {
694
+ "domain": {
695
+ "type": "string",
696
+ "default": "空",
697
+ "description": "需要获取 cookies 的域名"
698
+ }
699
+ },
700
+ "response": {
701
+ "cookies": {
702
+ "type": "string",
703
+ "description": "Cookies"
704
+ },
705
+ "csrf_token": {
706
+ "type": "int32",
707
+ "description": "CSRF Token"
708
+ }
709
+ }
710
+ },
711
+ "get_record": {
712
+ "title": "获取语音",
713
+ "params": {
714
+ "file": {
715
+ "type": "string",
716
+ "default": "-",
717
+ "description": "收到的语音文件名(消息段的 file 参数), 如 0B38145AA44505000B38145AA4450500.silk"
718
+ },
719
+ "out_format": {
720
+ "type": "string",
721
+ "default": "-",
722
+ "description": "要转换到的格式, 目前支持 mp3、amr、wma、m4a、spx、ogg、wav、flac"
723
+ }
724
+ },
725
+ "response": {
726
+ "file": {
727
+ "type": "string",
728
+ "description": "转换后的语音文件路径, 如 /home/somebody/cqhttp/data/record/0B38145AA44505000B38145AA4450500.mp3"
729
+ }
730
+ }
731
+ },
732
+ "can_send_image": {
733
+ "title": "检查是否可以发送图片",
734
+ "params": null,
735
+ "response": {
736
+ "yes": {
737
+ "type": "boolean",
738
+ "description": "是或否"
739
+ }
740
+ }
741
+ },
742
+ "can_send_record": {
743
+ "title": "检查是否可以发送语音",
744
+ "params": null,
745
+ "response": {
746
+ "yes": {
747
+ "type": "boolean",
748
+ "description": "是或否"
749
+ }
750
+ }
751
+ },
752
+ "get_version_info": {
753
+ "title": "获取版本信息",
754
+ "params": null,
755
+ "response": {
756
+ "app_name": {
757
+ "type": "string",
758
+ "description": "应用标识, 如 mirai-native"
759
+ },
760
+ "app_version": {
761
+ "type": "string",
762
+ "description": "应用版本, 如 1.2.3"
763
+ },
764
+ "protocol_version": {
765
+ "type": "string",
766
+ "description": "OneBot 标准版本, 如 v11"
767
+ }
768
+ }
769
+ },
770
+ "set_restart": {
771
+ "title": "重启 go-cqhttp",
772
+ "params": {
773
+ "delay": {
774
+ "type": "number",
775
+ "default": "0",
776
+ "description": "要延迟的毫秒数, 如果默认情况下无法重启, 可以尝试设置延迟为 2000 左右"
777
+ }
778
+ },
779
+ "response": null
780
+ },
781
+ "clean_cache": {
782
+ "title": "清理缓存",
783
+ "params": null,
784
+ "response": null
785
+ },
786
+ "set_group_portrait": {
787
+ "title": "设置群头像",
788
+ "params": {
789
+ "group_id": {
790
+ "type": "int64",
791
+ "description": "群号"
792
+ },
793
+ "file": {
794
+ "type": "string",
795
+ "description": "图片文件名"
796
+ },
797
+ "cache": {
798
+ "type": "int",
799
+ "description": "表示是否使用已缓存的文件"
800
+ }
801
+ },
802
+ "response": null
803
+ },
804
+ ".get_word_slices": {
805
+ "title": "获取中文分词 ( 隐藏 API )",
806
+ "params": {
807
+ "content": {
808
+ "type": "string",
809
+ "description": "内容"
810
+ }
811
+ },
812
+ "response": {
813
+ "slices": {
814
+ "type": "string[]",
815
+ "description": "词组"
816
+ }
817
+ }
818
+ },
819
+ ".ocr_image": {
820
+ "title": "图片 OCR",
821
+ "params": {
822
+ "image": {
823
+ "type": "string",
824
+ "description": "图片ID"
825
+ }
826
+ },
827
+ "response": {
828
+ "texts": {
829
+ "type": "TextDetection[]",
830
+ "description": "OCR结果"
831
+ },
832
+ "language": {
833
+ "type": "string",
834
+ "description": "语言"
835
+ }
836
+ },
837
+ "others": {
838
+ "text": {
839
+ "type": "string",
840
+ "description": "文本"
841
+ },
842
+ "confidence": {
843
+ "type": "int32",
844
+ "description": "置信度"
845
+ },
846
+ "coordinates": {
847
+ "type": "vector2",
848
+ "description": "坐标"
849
+ }
850
+ }
851
+ },
852
+ "get_group_system_msg": {
853
+ "title": "获取群系统消息",
854
+ "params": null,
855
+ "response": {
856
+ "invited_requests": {
857
+ "type": "InvitedRequest[]",
858
+ "description": "邀请消息列表"
859
+ },
860
+ "join_requests": {
861
+ "type": "JoinRequest[]",
862
+ "description": "进群消息列表"
863
+ }
864
+ },
865
+ "others": {
866
+ "request_id": {
867
+ "type": "int64",
868
+ "description": "请求ID"
869
+ },
870
+ "requester_uin": {
871
+ "type": "int64",
872
+ "description": "请求者ID"
873
+ },
874
+ "requester_nick": {
875
+ "type": "string",
876
+ "description": "请求者昵称"
877
+ },
878
+ "message": {
879
+ "type": "string",
880
+ "description": "验证消息"
881
+ },
882
+ "group_id": {
883
+ "type": "int64",
884
+ "description": "群号"
885
+ },
886
+ "group_name": {
887
+ "type": "string",
888
+ "description": "群名"
889
+ },
890
+ "checked": {
891
+ "type": "bool",
892
+ "description": "是否已被处理"
893
+ },
894
+ "actor": {
895
+ "type": "int64",
896
+ "description": "处理者, 未处理为0"
897
+ }
898
+ }
899
+ },
900
+ "upload_group_file": {
901
+ "title": "上传群文件",
902
+ "params": {
903
+ "group_id": {
904
+ "type": "int64",
905
+ "description": "群号"
906
+ },
907
+ "file": {
908
+ "type": "string",
909
+ "description": "本地文件路径"
910
+ },
911
+ "name": {
912
+ "type": "string",
913
+ "description": "储存名称"
914
+ },
915
+ "folder": {
916
+ "type": "string",
917
+ "description": "父目录ID"
918
+ }
919
+ },
920
+ "response": null
921
+ },
922
+ "get_group_file_system_info": {
923
+ "title": "获取群文件系统信息",
924
+ "params": {
925
+ "group_id": {
926
+ "type": "int64",
927
+ "description": "群号"
928
+ }
929
+ },
930
+ "response": {
931
+ "file_count": {
932
+ "type": "int32",
933
+ "description": "文件总数"
934
+ },
935
+ "limit_count": {
936
+ "type": "int32",
937
+ "description": "文件上限"
938
+ },
939
+ "used_space": {
940
+ "type": "int64",
941
+ "description": "已使用空间"
942
+ },
943
+ "total_space": {
944
+ "type": "int64",
945
+ "description": "空间上限"
946
+ }
947
+ }
948
+ },
949
+ "get_group_root_files": {
950
+ "title": "获取群根目录文件列表",
951
+ "params": {
952
+ "group_id": {
953
+ "type": "int64",
954
+ "description": "群号"
955
+ }
956
+ },
957
+ "response": {
958
+ "files": {
959
+ "type": "File[]",
960
+ "description": "文件列表"
961
+ },
962
+ "folders": {
963
+ "type": "Folder[]",
964
+ "description": "文件夹列表"
965
+ }
966
+ }
967
+ },
968
+ "get_group_files_by_folder": {
969
+ "title": "获取群子目录文件列表",
970
+ "params": {
971
+ "group_id": {
972
+ "type": "int64",
973
+ "description": "群号"
974
+ },
975
+ "folder_id": {
976
+ "type": "string",
977
+ "description": "文件夹ID 参考 Folder 对象"
978
+ }
979
+ },
980
+ "response": {
981
+ "files": {
982
+ "type": "File[]",
983
+ "description": "文件列表"
984
+ },
985
+ "folders": {
986
+ "type": "Folder[]",
987
+ "description": "文件夹列表"
988
+ }
989
+ }
990
+ },
991
+ "get_group_file_url": {
992
+ "title": "获取群文件资源链接",
993
+ "params": {
994
+ "group_id": {
995
+ "type": "int64",
996
+ "description": "群号"
997
+ },
998
+ "file_id": {
999
+ "type": "string",
1000
+ "description": "文件ID 参考 File 对象"
1001
+ },
1002
+ "busid": {
1003
+ "type": "int32",
1004
+ "description": "文件类型 参考 File 对象"
1005
+ }
1006
+ },
1007
+ "response": {
1008
+ "url": {
1009
+ "type": "string",
1010
+ "description": "文件下载链接"
1011
+ }
1012
+ },
1013
+ "others": {
1014
+ "folder_id": {
1015
+ "type": "string",
1016
+ "description": "文件夹ID"
1017
+ },
1018
+ "folder_name": {
1019
+ "type": "string",
1020
+ "description": "文件名"
1021
+ },
1022
+ "create_time": {
1023
+ "type": "int64",
1024
+ "description": "创建时间"
1025
+ },
1026
+ "creator": {
1027
+ "type": "int64",
1028
+ "description": "创建者"
1029
+ },
1030
+ "creator_name": {
1031
+ "type": "string",
1032
+ "description": "创建者名字"
1033
+ },
1034
+ "total_file_count": {
1035
+ "type": "int32",
1036
+ "description": "子文件数量"
1037
+ }
1038
+ }
1039
+ },
1040
+ "get_status": {
1041
+ "title": "获取状态",
1042
+ "params": null,
1043
+ "response": {
1044
+ "app_initialized": {
1045
+ "type": "bool",
1046
+ "description": "原 CQHTTP 字段, 恒定为 true"
1047
+ },
1048
+ "app_enabled": {
1049
+ "type": "bool",
1050
+ "description": "原 CQHTTP 字段, 恒定为 true"
1051
+ },
1052
+ "plugins_good": {
1053
+ "type": "bool",
1054
+ "description": "原 CQHTTP 字段, 恒定为 true"
1055
+ },
1056
+ "app_good": {
1057
+ "type": "bool",
1058
+ "description": "原 CQHTTP 字段, 恒定为 true"
1059
+ },
1060
+ "online": {
1061
+ "type": "bool",
1062
+ "description": "表示BOT是否在线"
1063
+ },
1064
+ "goold": {
1065
+ "type": "bool",
1066
+ "description": "同 online"
1067
+ },
1068
+ "stat": {
1069
+ "type": "Statistics",
1070
+ "description": "运行统计"
1071
+ }
1072
+ },
1073
+ "others": {
1074
+ "packet_received": {
1075
+ "type": "uint64",
1076
+ "description": "收到的数据包总数"
1077
+ },
1078
+ "packet_sent": {
1079
+ "type": "uint64",
1080
+ "description": "发送的数据包总数"
1081
+ },
1082
+ "packet_lost": {
1083
+ "type": "uint32",
1084
+ "description": "数据包丢失总数"
1085
+ },
1086
+ "message_received": {
1087
+ "type": "uint64",
1088
+ "description": "接受信息总数"
1089
+ },
1090
+ "message_sent": {
1091
+ "type": "uint64",
1092
+ "description": "发送信息总数"
1093
+ },
1094
+ "disconnect_times": {
1095
+ "type": "uint32",
1096
+ "description": "TCP 链接断开次数"
1097
+ },
1098
+ "lost_times": {
1099
+ "type": "uint32",
1100
+ "description": "账号掉线次数"
1101
+ }
1102
+ }
1103
+ },
1104
+ "get_group_at_all_remain": {
1105
+ "title": "获取群 @全体成员 剩余次数",
1106
+ "params": {
1107
+ "group_id": {
1108
+ "type": "int64",
1109
+ "description": "群号"
1110
+ }
1111
+ },
1112
+ "response": {
1113
+ "can_at_all": {
1114
+ "type": "bool",
1115
+ "description": "是否可以 @全体成员"
1116
+ },
1117
+ "remain_at_all_count_for_group": {
1118
+ "type": "int16",
1119
+ "description": "群内所有管理当天剩余 @全体成员 次数"
1120
+ },
1121
+ "remain_at_all_count_for_uin": {
1122
+ "type": "int16",
1123
+ "description": "Bot 当天剩余 @全体成员 次数"
1124
+ }
1125
+ }
1126
+ },
1127
+ ".handle_quick_operation": {
1128
+ "title": "对事件执行快速操作 ( 隐藏 API )",
1129
+ "params": {
1130
+ "context": {
1131
+ "type": "object",
1132
+ "default": "-",
1133
+ "description": "事件数据对象, 可做精简, 如去掉 message 等无用字段"
1134
+ },
1135
+ "operation": {
1136
+ "type": "object",
1137
+ "default": "-",
1138
+ "description": "快速操作对象, 例如 {\"ban\": true, \"reply\": \"请不要说脏话\"}"
1139
+ }
1140
+ },
1141
+ "response": null
1142
+ },
1143
+ "_get_vip_info": {
1144
+ "title": "获取VIP信息",
1145
+ "params": {
1146
+ "user_id": {
1147
+ "type": "int64",
1148
+ "default": "",
1149
+ "description": "QQ 号"
1150
+ }
1151
+ },
1152
+ "response": {
1153
+ "user_id": {
1154
+ "type": "int64",
1155
+ "description": "QQ 号"
1156
+ },
1157
+ "nickname": {
1158
+ "type": "string",
1159
+ "description": "用户昵称"
1160
+ },
1161
+ "level": {
1162
+ "type": "int64",
1163
+ "description": "QQ 等级"
1164
+ },
1165
+ "level_speed": {
1166
+ "type": "float64",
1167
+ "description": "等级加速度"
1168
+ },
1169
+ "vip_level": {
1170
+ "type": "string",
1171
+ "description": "会员等级"
1172
+ },
1173
+ "vip_growth_speed": {
1174
+ "type": "int64",
1175
+ "description": "会员成长速度"
1176
+ },
1177
+ "vip_growth_total": {
1178
+ "type": "int64",
1179
+ "description": "会员成长总值"
1180
+ }
1181
+ }
1182
+ },
1183
+ "_send_group_notice": {
1184
+ "title": "发送群公告",
1185
+ "params": {
1186
+ "group_id": {
1187
+ "type": "int64",
1188
+ "default": "",
1189
+ "description": "群号"
1190
+ },
1191
+ "content": {
1192
+ "type": "string",
1193
+ "default": "",
1194
+ "description": "公告内容"
1195
+ }
1196
+ },
1197
+ "response": null
1198
+ },
1199
+ "reload_event_filter": {
1200
+ "title": "重载事件过滤器",
1201
+ "params": null,
1202
+ "response": null
1203
+ },
1204
+ "download_file": {
1205
+ "title": "下载文件到缓存目录",
1206
+ "params": {
1207
+ "url": {
1208
+ "type": "string",
1209
+ "description": "链接地址"
1210
+ },
1211
+ "thread_count": {
1212
+ "type": "int32",
1213
+ "description": "下载线程数"
1214
+ },
1215
+ "headers": {
1216
+ "type": "string or array",
1217
+ "description": "自定义请求头"
1218
+ }
1219
+ },
1220
+ "response": {
1221
+ "file": {
1222
+ "type": "string",
1223
+ "description": "下载文件的*绝对路径*"
1224
+ }
1225
+ },
1226
+ "others": "error"
1227
+ },
1228
+ "get_online_clients": {
1229
+ "title": "获取当前账号在线客户端列表",
1230
+ "params": {
1231
+ "no_cache": {
1232
+ "type": "bool",
1233
+ "description": "是否无视缓存"
1234
+ }
1235
+ },
1236
+ "response": {
1237
+ "clients": {
1238
+ "type": "[]Device",
1239
+ "description": "在线客户端列表"
1240
+ }
1241
+ },
1242
+ "others": {
1243
+ "app_id": {
1244
+ "type": "int64",
1245
+ "description": "客户端ID"
1246
+ },
1247
+ "device_name": {
1248
+ "type": "string",
1249
+ "description": "设备名称"
1250
+ },
1251
+ "device_kind": {
1252
+ "type": "string",
1253
+ "description": "设备类型"
1254
+ }
1255
+ }
1256
+ },
1257
+ "get_group_msg_history": {
1258
+ "title": "获取群消息历史记录",
1259
+ "params": null,
1260
+ "response": {
1261
+ "messages": {
1262
+ "type": "[]Message",
1263
+ "description": "从起始序号开始的前19条消息"
1264
+ }
1265
+ },
1266
+ "others": {
1267
+ "message_seq": {
1268
+ "type": "int64",
1269
+ "description": "起始消息序号, 可通过 get_msg 获得"
1270
+ },
1271
+ "group_id": {
1272
+ "type": "int64",
1273
+ "description": "群号"
1274
+ }
1275
+ }
1276
+ },
1277
+ "set_essence_msg": {
1278
+ "title": "设置精华消息",
1279
+ "params": {
1280
+ "message_id": {
1281
+ "type": "int32",
1282
+ "description": "消息ID"
1283
+ }
1284
+ },
1285
+ "response": "error"
1286
+ },
1287
+ "delete_essence_msg": {
1288
+ "title": "移出精华消息",
1289
+ "params": {
1290
+ "message_id": {
1291
+ "type": "int32",
1292
+ "description": "消息ID"
1293
+ }
1294
+ },
1295
+ "response": "error"
1296
+ },
1297
+ "get_essence_msg_list": {
1298
+ "title": "获取精华消息列表",
1299
+ "params": {
1300
+ "group_id": {
1301
+ "type": "int64",
1302
+ "description": "群号"
1303
+ }
1304
+ },
1305
+ "response": "error"
1306
+ },
1307
+ "check_url_safely": {
1308
+ "title": "检查链接安全性",
1309
+ "params": {
1310
+ "url": {
1311
+ "type": "string",
1312
+ "description": "需要检查的链接"
1313
+ }
1314
+ },
1315
+ "response": {
1316
+ "level": {
1317
+ "type": "int",
1318
+ "description": "安全等级, 1: 安全 2: 未知 3: 危险"
1319
+ }
1320
+ }
1321
+ }
1322
+ }