discorb 0.12.4 → 0.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build_main.yml +1 -0
  3. data/.github/workflows/build_version.yml +4 -3
  4. data/.github/workflows/crowdin.yml +32 -0
  5. data/.gitignore +3 -1
  6. data/.yardopts +2 -0
  7. data/Changelog.md +412 -378
  8. data/Gemfile +5 -1
  9. data/README.md +2 -2
  10. data/Rakefile +131 -1
  11. data/crowdin.yml +2 -0
  12. data/discorb.gemspec +12 -1
  13. data/docs/Examples.md +2 -0
  14. data/docs/application_command.md +16 -12
  15. data/docs/cli/irb.md +2 -0
  16. data/docs/cli/new.md +2 -0
  17. data/docs/cli/run.md +3 -1
  18. data/docs/cli/setup.md +4 -2
  19. data/docs/cli.md +2 -0
  20. data/docs/events.md +59 -5
  21. data/docs/extension.md +2 -2
  22. data/docs/faq.md +4 -2
  23. data/docs/license.md +2 -0
  24. data/docs/tutorial.md +4 -3
  25. data/docs/voice_events.md +2 -0
  26. data/lib/discorb/app_command.rb +8 -7
  27. data/lib/discorb/application.rb +32 -2
  28. data/lib/discorb/asset.rb +1 -1
  29. data/lib/discorb/audit_logs.rb +28 -16
  30. data/lib/discorb/channel.rb +140 -81
  31. data/lib/discorb/client.rb +17 -19
  32. data/lib/discorb/common.rb +28 -1
  33. data/lib/discorb/components.rb +12 -0
  34. data/lib/discorb/dictionary.rb +1 -1
  35. data/lib/discorb/embed.rb +4 -0
  36. data/lib/discorb/emoji.rb +9 -7
  37. data/lib/discorb/emoji_table.rb +3891 -3891
  38. data/lib/discorb/event.rb +266 -24
  39. data/lib/discorb/event_handler.rb +39 -0
  40. data/lib/discorb/exe/show.rb +2 -0
  41. data/lib/discorb/extension.rb +5 -5
  42. data/lib/discorb/file.rb +4 -0
  43. data/lib/discorb/flag.rb +5 -1
  44. data/lib/discorb/gateway.rb +97 -17
  45. data/lib/discorb/gateway_requests.rb +4 -0
  46. data/lib/discorb/guild.rb +169 -82
  47. data/lib/discorb/guild_template.rb +12 -9
  48. data/lib/discorb/http.rb +82 -44
  49. data/lib/discorb/image.rb +7 -5
  50. data/lib/discorb/integration.rb +33 -1
  51. data/lib/discorb/intents.rb +8 -3
  52. data/lib/discorb/interaction/response.rb +27 -25
  53. data/lib/discorb/interaction/root.rb +8 -0
  54. data/lib/discorb/invite.rb +3 -2
  55. data/lib/discorb/log.rb +4 -0
  56. data/lib/discorb/member.rb +42 -13
  57. data/lib/discorb/message.rb +32 -17
  58. data/lib/discorb/modules.rb +19 -26
  59. data/lib/discorb/permission.rb +4 -0
  60. data/lib/discorb/rate_limit.rb +6 -2
  61. data/lib/discorb/role.rb +15 -11
  62. data/lib/discorb/sticker.rb +17 -12
  63. data/lib/discorb/user.rb +8 -7
  64. data/lib/discorb/voice_state.rb +8 -5
  65. data/lib/discorb/webhook.rb +38 -47
  66. data/lib/discorb.rb +2 -2
  67. data/po/yard.pot +7775 -5157
  68. data/sig/discorb.rbs +3317 -3820
  69. data/template-replace/scripts/locale_ja.rb +62 -0
  70. metadata +18 -5
data/Gemfile CHANGED
@@ -7,11 +7,15 @@ gemspec
7
7
 
8
8
  gem "rake", "~> 13.0"
9
9
 
10
- group :debug, optional: true do
10
+ group :development, optional: true do
11
11
  gem "rufo", "~> 0.13.0"
12
+ gem "sord", "~> 3.0.1"
12
13
  end
13
14
 
14
15
  group :docs, optional: true do
15
16
  gem "redcarpet"
16
17
  gem "yard", "~> 0.9.26"
18
+ gem "gettext", "~> 3.4.1"
19
+ gem "crowdin-api", "~> 1.0"
20
+ gem "rubyzip", "~> 2.3"
17
21
  end
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <div align="center"><img src="./assets/banner.svg" alt="discorb"></div>
2
2
 
3
- <div align="center"><a href="https://discorb-lib.github.io/"><img src="https://img.shields.io/badge/Document-discorb--lib.github.io-blue.svg?style=flat-square&labelColor=2f3136" alt="Document"></a>
3
+ <div align="center"><a href="https://discorb-lib.github.io/"><img src="https://img.shields.io/badge/Document-discorb--lib.github.io-blue.svg?style=flat-square&labelColor=2f3136&logo=github&logoColor=fff" alt="Document"></a>
4
4
  <a href="https://rubygems.org/gems/discorb"><img src="https://img.shields.io/gem/dt/discorb?logo=rubygems&logoColor=fff&label=Downloads&style=flat-square&labelColor=2f3136" alt="Gem"></a>
5
5
  <a href="https://rubygems.org/gems/discorb"><img src="https://img.shields.io/gem/v/discorb?logo=rubygems&logoColor=fff&label=Version&style=flat-square&labelColor=2f3136" alt="Gem"></a>
6
6
  <a href="https://discord.gg/hCP6zq8Vpj"><img src="https://img.shields.io/discord/863581274916913193?logo=discord&logoColor=fff&color=5865f2&label=Discord&style=flat-square&labelColor=2f3136" alt="Discord"></a>
@@ -9,7 +9,7 @@
9
9
 
10
10
  ----
11
11
 
12
- discorb is a Discord API wrapper written in Ruby.
12
+ discorb is a Discord API wrapper for Ruby, Using [socketry/async](https://github.com/socketry/async).
13
13
 
14
14
  ## Installation
15
15
 
data/Rakefile CHANGED
@@ -67,7 +67,7 @@ namespace :document do
67
67
 
68
68
  desc "Just generate document"
69
69
  task :yard do
70
- sh "bundle exec yardoc -o doc/#{version}"
70
+ sh "bundle exec yardoc -o doc/#{version} --locale #{ENV["rake_locale"] or "en"}"
71
71
  end
72
72
 
73
73
  desc "Replace files"
@@ -136,6 +136,12 @@ namespace :document do
136
136
  end
137
137
  sputs "Successfully replaced CRLF with LF"
138
138
  end
139
+
140
+ task :locale do
141
+ next if ENV["rake_locale"].nil?
142
+ require_relative "template-replace/scripts/locale_#{ENV["rake_locale"]}.rb"
143
+ replace_locale("doc/main")
144
+ end
139
145
  end
140
146
  task :replace => %i[replace:css replace:html replace:eol]
141
147
 
@@ -156,6 +162,7 @@ namespace :document do
156
162
  Rake::Task["document:replace:html"].execute
157
163
  Rake::Task["document:replace:css"].execute
158
164
  Rake::Task["document:replace:eol"].execute
165
+ Rake::Task["document:replace:locale"].execute
159
166
  tags = `git tag`.force_encoding("utf-8").split("\n").sort_by { |t| t[1..].split(".").map(&:to_i) }
160
167
  tags.each do |tag|
161
168
  sh "git checkout #{tag} -f"
@@ -166,6 +173,7 @@ namespace :document do
166
173
  Rake::Task["document:replace:html"].execute
167
174
  Rake::Task["document:replace:css"].execute
168
175
  Rake::Task["document:replace:eol"].execute
176
+ Rake::Task["document:replace:locale"].execute
169
177
  FileUtils.cp_r("./doc/.", "./tmp-doc")
170
178
  FileUtils.rm_rf("doc")
171
179
  end
@@ -190,6 +198,128 @@ namespace :document do
190
198
  end
191
199
  sputs "Successfully pushed documents"
192
200
  end
201
+
202
+ namespace :locale do
203
+ task :ja do
204
+ require "crowdin-api"
205
+ require "zip"
206
+ crowdin = Crowdin::Client.new do |config|
207
+ config.api_token = ENV["CROWDIN_PERSONAL_TOKEN"]
208
+ config.project_id = ENV["CROWDIN_PROJECT_ID"].to_i
209
+ end
210
+ build = crowdin.build_project_translation["data"]["id"]
211
+ crowdin.download_project_translations("./tmp.zip", build)
212
+
213
+ Zip::File.open("tmp.zip") do |zip|
214
+ zip.each do |entry|
215
+ zip.extract(entry, entry.name) { true }
216
+ end
217
+ end
218
+ ENV["rake_locale"] = "ja"
219
+ Rake::Task["document:yard"].execute
220
+ Rake::Task["document:replace"].execute
221
+ end
222
+
223
+ task :en do
224
+ Rake::Task["document"].execute("locale:en")
225
+ end
226
+ end
227
+ end
228
+
229
+ task :rbs do
230
+ require "open3"
231
+ type_errors = {
232
+ "SORD_ERROR_SymbolSymbolSymbolInteger" => "{ r: Integer, g: Integer, b: Integer}",
233
+ "SORD_ERROR_DiscorbRoleDiscorbMemberDiscorbPermissionOverwrite" => "Hash[Discorb::Role | Discorb::Member, Discorb::PermissionOverwrite]",
234
+ "SORD_ERROR_DiscorbRoleDiscorbMemberPermissionOverwrite" => "Hash[Discorb::Role | Discorb::Member, Discorb::PermissionOverwrite]",
235
+ "SORD_ERROR_f | SORD_ERROR_F | SORD_ERROR_d | SORD_ERROR_D | SORD_ERROR_t | SORD_ERROR_T | SORD_ERROR_R" => '"f" | "F" | "d" | "D" | "t" | "T" | "R"',
236
+ "SORD_ERROR_dark | SORD_ERROR_light" => '"dark" | "light"',
237
+ "SORD_ERROR_SymbolStringSymbolboolSymbolObject" => "String | Integer | Float",
238
+ }
239
+ regenerate = ARGV.include?("--regenerate") || ARGV.include?("-r")
240
+
241
+ sh "sord gen sig/discorb.rbs --keep-original-comments --no-sord-comments" + (regenerate ? " --regenerate" : " --no-regenerate")
242
+ base = File.read("sig/discorb.rbs")
243
+ base.gsub!(/\n +def _set_data: \(.+\) -> untyped\n\n/, "")
244
+ base.gsub!(/( )?( *)# @private.+?(?:\n\n(?=\1\2#)|(?=\n\2end))/sm, "")
245
+ base.gsub!(/untyped ([a-z_]*id)/, "_ToS \\1")
246
+ # #region rbs dictionary
247
+ base.gsub!(/ class Dictionary.+?end\n/ms, <<-RBS)
248
+ class Dictionary[K, V]
249
+ #
250
+ # Initialize a new Dictionary.
251
+ #
252
+ # @param [Hash] hash A hash of items to add to the dictionary.
253
+ # @param [Integer] limit The maximum number of items in the dictionary.
254
+ # @param [false, Proc] sort Whether to sort the items in the dictionary.
255
+ def initialize: (?::Hash[untyped, untyped] hash, ?limit: Integer?, ?sort: (bool | Proc)) -> void
256
+
257
+ #
258
+ # Registers a new item in the dictionary.
259
+ #
260
+ # @param [#to_s] id The ID of the item.
261
+ # @param [Object] body The item to register.
262
+ #
263
+ # @return [self] The dictionary.
264
+ def register: (_ToS id, Object body) -> self
265
+
266
+ #
267
+ # Merges another dictionary into this one.
268
+ #
269
+ # @param [Discorb::Dictionary] other The dictionary to merge.
270
+ def merge: (Discorb::Dictionary other) -> untyped
271
+
272
+ #
273
+ # Removes an item from the dictionary.
274
+ #
275
+ # @param [#to_s] id The ID of the item to remove.
276
+ def remove: (_ToS id) -> untyped
277
+
278
+ #
279
+ # Get an item from the dictionary.
280
+ #
281
+ # @param [#to_s] id The ID of the item.
282
+ # @return [Object] The item.
283
+ # @return [nil] if the item was not found.
284
+ #
285
+ # @overload get(index)
286
+ # @param [Integer] index The index of the item.
287
+ #
288
+ # @return [Object] The item.
289
+ # @return [nil] if the item is not found.
290
+ def get: (K id) -> V?
291
+
292
+ #
293
+ # Returns the values of the dictionary.
294
+ #
295
+ # @return [Array] The values of the dictionary.
296
+ def values: () -> ::Array[V]
297
+
298
+ #
299
+ # Checks if the dictionary has an ID.
300
+ #
301
+ # @param [#to_s] id The ID to check.
302
+ #
303
+ # @return [Boolean] `true` if the dictionary has the ID, `false` otherwise.
304
+ def has?: (_ToS id) -> bool
305
+
306
+ #
307
+ # Send a message to the array of values.
308
+ def method_missing: (untyped name) -> untyped
309
+
310
+ def respond_to_missing?: (untyped name, untyped args, untyped kwargs) -> bool
311
+
312
+ def inspect: () -> untyped
313
+
314
+ # @return [Integer] The maximum number of items in the dictionary.
315
+ attr_accessor limit: Integer
316
+ end
317
+ RBS
318
+ # #endregion
319
+ type_errors.each do |error, type|
320
+ base.gsub!(error, type)
321
+ end
322
+ File.write("sig/discorb.rbs", base)
193
323
  end
194
324
 
195
325
  task :document => %i[document:yard document:replace]
data/crowdin.yml CHANGED
@@ -1,3 +1,5 @@
1
1
  files:
2
2
  - source: /po/yard.pot
3
3
  translation: /po/%two_letters_code%.po
4
+ project_id_env: CROWDIN_PROJECT_ID
5
+ api_token_env: CROWDIN_PERSONAL_TOKEN
data/discorb.gemspec CHANGED
@@ -8,7 +8,18 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ["sevenc-nanashi"]
9
9
  spec.email = ["sevenc-nanashi@sevenbot.jp"]
10
10
 
11
- spec.summary = "A discord API wrapper written in Ruby"
11
+ spec.summary = "A Discord API wrapper for Ruby, Using socketry/async."
12
+ spec.description = <<~RDOC
13
+ == discorb
14
+ discorb is a Discord API wrapper for Ruby, Using {socketry/async}[https://github.com/socketry/async].
15
+
16
+ === Contributing
17
+ Bug reports, feature requests, and pull requests are welcome on {the GitHub repository}[https://github.com/discorb-lib/discorb].
18
+
19
+ === License
20
+ This gem is licensed under the MIT License.
21
+
22
+ RDOC
12
23
  spec.homepage = "https://github.com/discorb-lib/discorb"
13
24
  spec.license = "MIT"
14
25
  spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
data/docs/Examples.md CHANGED
@@ -1,4 +1,6 @@
1
+ <!--
1
2
  # @title Examples
3
+ -->
2
4
 
3
5
  # Examples
4
6
 
@@ -1,4 +1,6 @@
1
+ <!--
1
2
  # @title Application Commands
3
+ -->
2
4
 
3
5
  # Application Commands
4
6
 
@@ -10,7 +12,7 @@ From: [Discord API docs](https://discord.com/developers/docs/interactions/applic
10
12
 
11
13
  ## How do I register an application command?
12
14
 
13
- Write to a your script:
15
+ Write to your script:
14
16
  - {Discorb::ApplicationCommand::Handler.slash}, {Discorb::ApplicationCommand::Handler.slash_group} for slash commands,
15
17
  - {Discorb::ApplicationCommand::Handler.user_command} for user menu commands,
16
18
  - {Discorb::ApplicationCommand::Handler.message_command} for message menu commands.
@@ -49,6 +51,8 @@ client.run(ENV["DISCORD_BOT_TOKEN"])
49
51
  | `guild_ids` | The ID of the guild to register the command in. |
50
52
  | `block` | A block that will be called when the command is invoked. |
51
53
 
54
+ Block will be called with a {Discorb::Interaction} object and specified options.
55
+
52
56
  In `options`, hash should be like this:
53
57
 
54
58
  ```ruby
@@ -66,7 +70,7 @@ In `options`, hash should be like this:
66
70
  | `:required` | Whether the argument is required. `optional` will be used if not specified. |
67
71
  | `:optional` | Whether the argument is optional. `required` will be used if not specified. |
68
72
  | `:type` | `Object` | Type of the option. |
69
- | `:choice` | `Hash{String => String, Integer, Float}` | Type of the option. |
73
+ | `:choice` | `Hash{String => String, Integer, Float}` | Choice of the option. |
70
74
  | `:default` | `Object` | Default value of the option. |
71
75
  | `:channel_types` | `Array<Class<Discorb::Channel>>` | Type of the channel option. |
72
76
  | `:autocomplete` | `Proc` | Autocomplete function. |
@@ -121,16 +125,16 @@ group.slash("message_expand", "Whether bot should expand message.", {
121
125
  type: :boolean,
122
126
  description: "Whether bot should expand message."
123
127
  }
124
- }) do |interaction|
128
+ }) do |interaction, enabled|
125
129
  # ...
126
130
  end
127
131
 
128
- group.slash("bump_alert", "Whether bot should notify DISBOARD bump.", {
132
+ group.slash("level", "Whether level system is enabled.", {
129
133
  "enabled" => {
130
134
  type: :boolean,
131
- description: "Whether bot should notify DISBOARD bump."
135
+ description: "Whether level system is enabled."
132
136
  }
133
- }) do |interaction|
137
+ }) do |interaction, enabled|
134
138
  # ...
135
139
  end
136
140
 
@@ -146,15 +150,15 @@ client.slash_group("settings", "Set settings of bot.") do |group|
146
150
  type: :boolean,
147
151
  description: "Whether bot should expand message."
148
152
  }
149
- }) do |interaction|
153
+ }) do |interaction, enabled|
150
154
  # ...
151
155
  end
152
- group.slash("bump_alert", "Whether bot should notify DISBOARD bump.", {
156
+ group.slash("bump_alert", "Whether level system is enabled.", {
153
157
  "enabled" => {
154
158
  type: :boolean,
155
- description: "Whether bot should notify DISBOARD bump."
159
+ description: "Whether level system is enabled."
156
160
  }
157
- }) do |interaction|
161
+ }) do |interaction, enabled|
158
162
  # ...
159
163
  end
160
164
  end
@@ -243,9 +247,9 @@ Same as above, you can use block for register commands since v0.5.1.
243
247
 
244
248
  #### Use Auto Completing
245
249
 
246
- Since v0.11.0, you can use auto completion by setting Proc to `:autocomplete` in options.
250
+ Since v0.11.0, you can use auto-completion by setting Proc to `:autocomplete` in options.
247
251
  The proc will be called with interaction object and the argument.
248
- The proc should return an hash of the autocomplete result.
252
+ The proc should return a hash of the autocomplete result.
249
253
 
250
254
  ```ruby
251
255
  client.slash("hello2", "Greet for you", {
data/docs/cli/irb.md CHANGED
@@ -1,4 +1,6 @@
1
+ <!--
1
2
  # @title CLI: discorb irb
3
+ -->
2
4
 
3
5
  # discorb irb
4
6
 
data/docs/cli/new.md CHANGED
@@ -1,4 +1,6 @@
1
+ <!--
1
2
  # @title CLI: discorb new
3
+ -->
2
4
 
3
5
  # discorb new
4
6
 
data/docs/cli/run.md CHANGED
@@ -1,4 +1,6 @@
1
+ <!--
1
2
  # @title CLI: discorb run
3
+ -->
2
4
 
3
5
  # discorb run
4
6
 
@@ -50,7 +52,7 @@ If not specified, the default will be:
50
52
 
51
53
  #### `-s`, `--setup`
52
54
 
53
- Whether to setup application commands.
55
+ Whether to set up application commands.
54
56
 
55
57
  #### `-e`, `--env`
56
58
 
data/docs/cli/setup.md CHANGED
@@ -1,8 +1,10 @@
1
+ <!--
1
2
  # @title CLI: discorb setup
3
+ -->
2
4
 
3
5
  # discorb setup
4
6
 
5
- This command will setup application commands, and call `setup` event.
7
+ This command will set up application commands, and call `setup` event.
6
8
 
7
9
  ## Usage
8
10
 
@@ -14,7 +16,7 @@ discorb setup [options] [script]
14
16
 
15
17
  #### `script`
16
18
 
17
- The script to setup. Defaults to `main.rb`.
19
+ The script to set up. Defaults to `main.rb`.
18
20
 
19
21
  ### Options
20
22
 
data/docs/cli.md CHANGED
@@ -1,4 +1,6 @@
1
+ <!--
1
2
  # @title CLI tools
3
+ -->
2
4
 
3
5
  # CLI tools
4
6
 
data/docs/events.md CHANGED
@@ -1,4 +1,6 @@
1
+ <!--
1
2
  # @title Events
3
+ -->
2
4
 
3
5
  # Events
4
6
 
@@ -64,7 +66,7 @@ end
64
66
  ### Client events
65
67
 
66
68
  #### `event_receive(event_name, data)`
67
- Fires when a event is received.
69
+ Fires when an event is received.
68
70
 
69
71
  | Parameter | Type | Description |
70
72
  | ---------- | ----- | ----------- |
@@ -411,7 +413,7 @@ Fires when a role is deleted.
411
413
 
412
414
  #### Note
413
415
 
414
- These events requires the `guild_members` intent.
416
+ These events require the `guild_members` intent.
415
417
 
416
418
  #### `member_add(member)`
417
419
 
@@ -469,7 +471,7 @@ Fires when a role is deleted.
469
471
 
470
472
  #### `invite_create(invite)`
471
473
 
472
- Fires when a invite is created.
474
+ Fires when an invitation is created.
473
475
 
474
476
  | Parameter | Type | Description |
475
477
  | ---------- | ----- | ----------- |
@@ -477,7 +479,7 @@ Fires when a invite is created.
477
479
 
478
480
  #### `invite_delete(invite)`
479
481
 
480
- Fires when a invite is deleted.
482
+ Fires when an invitation is deleted.
481
483
 
482
484
  | Parameter | Type | Description |
483
485
  | ---------- | ----- | ----------- |
@@ -503,7 +505,50 @@ Fires when a select menu is selected.
503
505
 
504
506
  ### Voice events
505
507
 
506
- It's too big, so they're documented in {file:docs/voice_events.md}
508
+ Because it's big, it's documented in {file:docs/voice_events.md}.
509
+
510
+ ### Guild scheduled event events
511
+
512
+ #### `scheduled_event_create(event)`
513
+
514
+ Fires when a scheduled event is created.
515
+
516
+ | Parameter | Type | Description |
517
+ | ---------- | ----- | ----------- |
518
+ | `event` | {Discorb::ScheduledEvent}| The created scheduled event. |
519
+
520
+ #### `scheduled_event_cancel(event)`, `scheduled_event_delete(event)`
521
+
522
+ Fires when a scheduled event is canceled or deleted.
523
+
524
+ | Parameter | Type | Description |
525
+ | ---------- | ----- | ----------- |
526
+ | `event` | {Discorb::ScheduledEvent}| The deleted scheduled event. |
527
+
528
+ #### `scheduled_event_edit(before, after)`
529
+
530
+ Fires when a scheduled event is edited.
531
+
532
+ | Parameter | Type | Description |
533
+ | ---------- | ----- | ----------- |
534
+ | `before` | {Discorb::ScheduledEvent}| The scheduled event before the edit. |
535
+ | `after` | {Discorb::ScheduledEvent}| The scheduled event after the edit. |
536
+
537
+ #### `scheduled_event_start(event)`
538
+
539
+ Fires when a scheduled event is started.
540
+
541
+ | Parameter | Type | Description |
542
+ | ---------- | ----- | ----------- |
543
+ | `event` | {Discorb::ScheduledEvent}| The scheduled event that started. |
544
+
545
+ #### `scheduled_event_end(event)`
546
+
547
+ Fires when a scheduled event is ended.
548
+
549
+ | Parameter | Type | Description |
550
+ | ---------- | ----- | ----------- |
551
+ | `event` | {Discorb::ScheduledEvent}| The scheduled event that ended. |
507
552
 
508
553
  ### Low-level events
509
554
 
@@ -530,3 +575,12 @@ Fires when `THREAD_CREATE` is received.
530
575
  | Parameter | Type | Description |
531
576
  | ---------- | ----- | ----------- |
532
577
  |`thread` | {Discorb::ThreadChannel}| The thread of the event. |
578
+
579
+ #### `scheduled_event_update(before, after)`
580
+
581
+ Fires when `SCHEDULED_EVENT_UPDATE` is received.
582
+
583
+ | Parameter | Type | Description |
584
+ | ---------- | ----- | ----------- |
585
+ | `before` | {Discorb::ScheduledEvent}| The scheduled event before the update. |
586
+ |`after` | {Discorb::ScheduledEvent}| The scheduled event after the update. |
data/docs/extension.md CHANGED
@@ -1,11 +1,11 @@
1
+ <!--
1
2
  # @title Extension
3
+ -->
2
4
 
3
5
  # Extension
4
6
 
5
7
  Extension allows you to seperate events.
6
8
 
7
- # @since
8
-
9
9
  ## Make a new extension
10
10
 
11
11
  Make a new class that includes Extension.
data/docs/faq.md CHANGED
@@ -1,4 +1,6 @@
1
+ <!--
1
2
  # @title FAQ
3
+ -->
2
4
 
3
5
  # Fequently asked questions
4
6
 
@@ -6,7 +8,7 @@
6
8
 
7
9
  ### What is `Async::Task`?
8
10
 
9
- Async::Task is a object for asynchronous tasks.
11
+ Async::Task is an object for asynchronous tasks.
10
12
 
11
13
  https://socketry.github.io/async/ for more information.
12
14
 
@@ -16,7 +18,7 @@ It means a `server` of Discord.
16
18
 
17
19
  ### What is difference between `User` and `Member`?
18
20
 
19
- `User` is a object for account, `Member` is a object for user in guild.
21
+ `User` is an object for account, `Member` is an object for user in guild.
20
22
 
21
23
  ## How can I ...?
22
24
 
data/docs/license.md CHANGED
@@ -1,4 +1,6 @@
1
+ <!--
1
2
  # @title License
3
+ -->
2
4
 
3
5
  # License
4
6
 
data/docs/tutorial.md CHANGED
@@ -1,4 +1,6 @@
1
+ <!--
1
2
  # @title Tutorial
3
+ -->
2
4
 
3
5
  # Tutorial
4
6
 
@@ -162,7 +164,7 @@ You can see your bot's response by typing `hello` in your server...
162
164
 
163
165
  ![](./assets/07_hello_infinite.png)
164
166
 
165
- Oh no! Your bot is responding to bot's messages, and it doesn't stop!
167
+ Oops! Your bot is responding to bot's messages, it's infinite!
166
168
 
167
169
  Terminate your bot by typing `Ctrl + C` in terminal.
168
170
 
@@ -192,5 +194,4 @@ You did it! Your bot won't respond to bot's messages anymore.
192
194
  This is the end of tutorial.
193
195
 
194
196
  To learn more, check out the [documentation](https://discorb-lib.github.io/).
195
-
196
- We hope you enjoy this lib! Thanks for reading!
197
+ You can also check out [Examples](docs/examples).
data/docs/voice_events.md CHANGED
@@ -1,4 +1,6 @@
1
+ <!--
1
2
  # @title Voice Events
3
+ -->
2
4
 
3
5
  # Voice Events
4
6
 
@@ -34,8 +34,8 @@ module Discorb
34
34
  #
35
35
  # @return [Discorb::ApplicationCommand::Command::SlashCommand] Command object.
36
36
  #
37
- # @see file:docs/application_command.md#register-slash-command
38
- # @see file:docs/cli/setup.md
37
+ # @see file:docs/application_command.md#register-slash-command Application Comamnds: Register Slash Command
38
+ # @see file:docs/cli/setup.md CLI: setup
39
39
  #
40
40
  def slash(command_name, description, options = {}, guild_ids: nil, &block)
41
41
  command = Discorb::ApplicationCommand::Command::SlashCommand.new(command_name, description, options, guild_ids, block, 1, "")
@@ -56,8 +56,8 @@ module Discorb
56
56
  #
57
57
  # @return [Discorb::ApplicationCommand::Command::GroupCommand] Command object.
58
58
  #
59
- # @see file:docs/slash_command.md
60
- # @see file:docs/cli/setup.md
59
+ # @see file:docs/application_command.md Application Commands
60
+ # @see file:docs/cli/setup.md CLI: setup
61
61
  #
62
62
  def slash_group(command_name, description, guild_ids: nil, &block)
63
63
  command = Discorb::ApplicationCommand::Command::GroupCommand.new(command_name, description, guild_ids, nil, self)
@@ -73,7 +73,7 @@ module Discorb
73
73
  # @param [Array<#to_s>, false, nil] guild_ids Guild IDs to set the command to. `false` to global command, `nil` to use default.
74
74
  # @param [Proc] block Command block.
75
75
  # @yield [interaction, message] Block to execute.
76
- # @yieldparam [Discorb::ApplicationCommandInteraction::UserMenuCommand] interaction Interaction object.
76
+ # @yieldparam [Discorb::CommandInteraction::UserMenuCommand] interaction Interaction object.
77
77
  # @yieldparam [Discorb::Message] message Message object.
78
78
  #
79
79
  # @return [Discorb::ApplicationCommand::Command] Command object.
@@ -91,7 +91,7 @@ module Discorb
91
91
  # @param [Array<#to_s>, false, nil] guild_ids Guild IDs to set the command to. `false` to global command, `nil` to use default.
92
92
  # @param [Proc] block Command block.
93
93
  # @yield [interaction, user] Block to execute.
94
- # @yieldparam [Discorb::ApplicationCommandInteraction::UserMenuCommand] interaction Interaction object.
94
+ # @yieldparam [Discorb::CommandInteraction::UserMenuCommand] interaction Interaction object.
95
95
  # @yieldparam [Discorb::User] user User object.
96
96
  #
97
97
  # @return [Discorb::ApplicationCommand::Command] Command object.
@@ -104,6 +104,7 @@ module Discorb
104
104
 
105
105
  #
106
106
  # Setup commands.
107
+ # @async
107
108
  # @see Client#initialize
108
109
  #
109
110
  # @param [String] token Bot token.
@@ -309,7 +310,7 @@ module Discorb
309
310
  #
310
311
  # @return [Discorb::ApplicationCommand::Command::SubcommandGroup] Command object.
311
312
  #
312
- # @see file:docs/slash_command.md
313
+ # @see file:docs/application_command.md Application Commands
313
314
  #
314
315
  def group(command_name, description, &block)
315
316
  command = Discorb::ApplicationCommand::Command::SubcommandGroup.new(command_name, description, @name, @client)