discorb 0.13.0 → 0.13.1
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.
- checksums.yaml +4 -4
- data/.github/workflows/build_main.yml +1 -0
- data/.github/workflows/build_version.yml +1 -0
- data/.github/workflows/crowdin.yml +32 -0
- data/.gitignore +3 -1
- data/.yardopts +2 -0
- data/Changelog.md +399 -388
- data/Gemfile +5 -1
- data/README.md +1 -1
- data/Rakefile +139 -9
- data/crowdin.yml +2 -0
- data/docs/Examples.md +2 -0
- data/docs/application_command.md +7 -5
- data/docs/cli/irb.md +2 -0
- data/docs/cli/new.md +2 -0
- data/docs/cli/run.md +3 -1
- data/docs/cli/setup.md +4 -2
- data/docs/cli.md +2 -0
- data/docs/events.md +6 -4
- data/docs/extension.md +2 -2
- data/docs/faq.md +4 -2
- data/docs/license.md +2 -0
- data/docs/tutorial.md +4 -3
- data/docs/voice_events.md +2 -0
- data/lib/discorb/app_command.rb +8 -7
- data/lib/discorb/application.rb +1 -1
- data/lib/discorb/channel.rb +100 -76
- data/lib/discorb/client.rb +13 -15
- data/lib/discorb/common.rb +3 -1
- data/lib/discorb/emoji.rb +5 -7
- data/lib/discorb/emoji_table.rb +3891 -3891
- data/lib/discorb/event.rb +8 -7
- data/lib/discorb/exe/show.rb +2 -0
- data/lib/discorb/extension.rb +1 -1
- data/lib/discorb/flag.rb +1 -1
- data/lib/discorb/gateway.rb +9 -13
- data/lib/discorb/guild.rb +63 -89
- data/lib/discorb/guild_template.rb +12 -9
- data/lib/discorb/http.rb +82 -44
- data/lib/discorb/integration.rb +3 -0
- data/lib/discorb/interaction/response.rb +27 -25
- data/lib/discorb/interaction/root.rb +8 -0
- data/lib/discorb/invite.rb +3 -2
- data/lib/discorb/member.rb +41 -12
- data/lib/discorb/message.rb +28 -17
- data/lib/discorb/modules.rb +19 -26
- data/lib/discorb/role.rb +15 -11
- data/lib/discorb/sticker.rb +8 -12
- data/lib/discorb/user.rb +7 -7
- data/lib/discorb/voice_state.rb +8 -5
- data/lib/discorb/webhook.rb +38 -47
- data/lib/discorb.rb +1 -1
- data/po/yard.pot +7772 -5154
- data/sig/discorb.rbs +3316 -3819
- data/template-replace/scripts/locale_ja.rb +62 -0
- metadata +5 -3
data/Gemfile
CHANGED
@@ -7,11 +7,15 @@ gemspec
|
|
7
7
|
|
8
8
|
gem "rake", "~> 13.0"
|
9
9
|
|
10
|
-
group :
|
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>
|
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
|
|
@@ -152,20 +158,22 @@ namespace :document do
|
|
152
158
|
iputs "Building all versions"
|
153
159
|
FileUtils.rm_rf("doc") rescue nil
|
154
160
|
FileUtils.cp_r("./template-replace/.", "./tmp-template-replace")
|
155
|
-
Rake::Task["document:yard"].
|
156
|
-
Rake::Task["document:replace:html"].
|
157
|
-
Rake::Task["document:replace:css"].
|
158
|
-
Rake::Task["document:replace:eol"].
|
161
|
+
Rake::Task["document:yard"].invoke
|
162
|
+
Rake::Task["document:replace:html"].invoke
|
163
|
+
Rake::Task["document:replace:css"].invoke
|
164
|
+
Rake::Task["document:replace:eol"].invoke
|
165
|
+
Rake::Task["document:replace:locale"].invoke
|
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"
|
162
169
|
iputs "Building #{tag}"
|
163
170
|
FileUtils.cp_r("./tmp-template-replace/.", "./template-replace")
|
164
171
|
version = tag.delete_prefix("v")
|
165
|
-
Rake::Task["document:yard"].
|
166
|
-
Rake::Task["document:replace:html"].
|
167
|
-
Rake::Task["document:replace:css"].
|
168
|
-
Rake::Task["document:replace:eol"].
|
172
|
+
Rake::Task["document:yard"].invoke
|
173
|
+
Rake::Task["document:replace:html"].invoke
|
174
|
+
Rake::Task["document:replace:css"].invoke
|
175
|
+
Rake::Task["document:replace:eol"].invoke
|
176
|
+
Rake::Task["document:replace:locale"].invoke
|
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"].invoke
|
220
|
+
Rake::Task["document:replace"].invoke
|
221
|
+
end
|
222
|
+
|
223
|
+
task :en do
|
224
|
+
Rake::Task["document"].invoke("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
data/docs/Examples.md
CHANGED
data/docs/application_command.md
CHANGED
@@ -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
|
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,7 +51,7 @@ 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
|
|
52
|
-
Block will be called with a {Discorb::
|
54
|
+
Block will be called with a {Discorb::Interaction} object and specified options.
|
53
55
|
|
54
56
|
In `options`, hash should be like this:
|
55
57
|
|
@@ -68,7 +70,7 @@ In `options`, hash should be like this:
|
|
68
70
|
| `:required` | Whether the argument is required. `optional` will be used if not specified. |
|
69
71
|
| `:optional` | Whether the argument is optional. `required` will be used if not specified. |
|
70
72
|
| `:type` | `Object` | Type of the option. |
|
71
|
-
| `:choice` | `Hash{String => String, Integer, Float}` |
|
73
|
+
| `:choice` | `Hash{String => String, Integer, Float}` | Choice of the option. |
|
72
74
|
| `:default` | `Object` | Default value of the option. |
|
73
75
|
| `:channel_types` | `Array<Class<Discorb::Channel>>` | Type of the channel option. |
|
74
76
|
| `:autocomplete` | `Proc` | Autocomplete function. |
|
@@ -245,9 +247,9 @@ Same as above, you can use block for register commands since v0.5.1.
|
|
245
247
|
|
246
248
|
#### Use Auto Completing
|
247
249
|
|
248
|
-
Since v0.11.0, you can use auto
|
250
|
+
Since v0.11.0, you can use auto-completion by setting Proc to `:autocomplete` in options.
|
249
251
|
The proc will be called with interaction object and the argument.
|
250
|
-
The proc should return
|
252
|
+
The proc should return a hash of the autocomplete result.
|
251
253
|
|
252
254
|
```ruby
|
253
255
|
client.slash("hello2", "Greet for you", {
|
data/docs/cli/irb.md
CHANGED
data/docs/cli/new.md
CHANGED
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
|
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
|
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
|
19
|
+
The script to set up. Defaults to `main.rb`.
|
18
20
|
|
19
21
|
### Options
|
20
22
|
|
data/docs/cli.md
CHANGED
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
|
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
|
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
|
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
|
482
|
+
Fires when an invitation is deleted.
|
481
483
|
|
482
484
|
| Parameter | Type | Description |
|
483
485
|
| ---------- | ----- | ----------- |
|
data/docs/extension.md
CHANGED
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
|
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
|
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
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
|

|
164
166
|
|
165
|
-
|
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
data/lib/discorb/app_command.rb
CHANGED
@@ -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/
|
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::
|
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::
|
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/
|
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)
|
data/lib/discorb/application.rb
CHANGED
@@ -131,7 +131,7 @@ module Discorb
|
|
131
131
|
# @return [:invited, :accepted] The member's membership state.
|
132
132
|
attr_reader :membership_state
|
133
133
|
alias state membership_state
|
134
|
-
# @return [Array<
|
134
|
+
# @return [Array<Symbol>] The permissions of the member.
|
135
135
|
# @note This always return `:*`.
|
136
136
|
attr_reader :permissions
|
137
137
|
|