discorb 0.18.0 → 0.20.0
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_version.yml +2 -2
- data/.rubocop.yml +12 -75
- data/Changelog.md +25 -0
- data/Gemfile +4 -4
- data/README.md +2 -1
- data/Rakefile +482 -459
- data/Steepfile +8 -6
- data/docs/application_command.md +1 -0
- data/docs/events.md +2 -2
- data/docs/voice_events.md +6 -6
- data/lib/discorb/allowed_mentions.rb +68 -72
- data/lib/discorb/app_command/command.rb +466 -394
- data/lib/discorb/app_command/common.rb +65 -25
- data/lib/discorb/app_command/handler.rb +304 -265
- data/lib/discorb/app_command.rb +5 -5
- data/lib/discorb/application.rb +198 -197
- data/lib/discorb/asset.rb +101 -101
- data/lib/discorb/attachment.rb +134 -119
- data/lib/discorb/audit_logs.rb +412 -385
- data/lib/discorb/automod.rb +279 -269
- data/lib/discorb/channel/base.rb +107 -108
- data/lib/discorb/channel/category.rb +32 -32
- data/lib/discorb/channel/container.rb +44 -44
- data/lib/discorb/channel/dm.rb +26 -28
- data/lib/discorb/channel/guild.rb +311 -246
- data/lib/discorb/channel/stage.rb +156 -140
- data/lib/discorb/channel/text.rb +430 -336
- data/lib/discorb/channel/thread.rb +374 -325
- data/lib/discorb/channel/voice.rb +85 -79
- data/lib/discorb/channel.rb +5 -5
- data/lib/discorb/client.rb +635 -623
- data/lib/discorb/color.rb +178 -182
- data/lib/discorb/common.rb +168 -164
- data/lib/discorb/components/button.rb +107 -106
- data/lib/discorb/components/select_menu.rb +157 -145
- data/lib/discorb/components/text_input.rb +103 -106
- data/lib/discorb/components.rb +68 -66
- data/lib/discorb/dictionary.rb +135 -135
- data/lib/discorb/embed.rb +404 -398
- data/lib/discorb/emoji.rb +309 -302
- data/lib/discorb/emoji_table.rb +16099 -8857
- data/lib/discorb/error.rb +131 -131
- data/lib/discorb/event.rb +360 -314
- data/lib/discorb/event_handler.rb +39 -39
- data/lib/discorb/exe/about.rb +17 -17
- data/lib/discorb/exe/irb.rb +72 -67
- data/lib/discorb/exe/new.rb +323 -315
- data/lib/discorb/exe/run.rb +69 -68
- data/lib/discorb/exe/setup.rb +57 -55
- data/lib/discorb/exe/show.rb +12 -12
- data/lib/discorb/extend.rb +25 -45
- data/lib/discorb/extension.rb +89 -83
- data/lib/discorb/flag.rb +126 -128
- data/lib/discorb/gateway.rb +984 -794
- data/lib/discorb/gateway_events.rb +670 -638
- data/lib/discorb/gateway_requests.rb +45 -48
- data/lib/discorb/guild.rb +2115 -1626
- data/lib/discorb/guild_template.rb +280 -241
- data/lib/discorb/http.rb +247 -232
- data/lib/discorb/image.rb +42 -42
- data/lib/discorb/integration.rb +169 -161
- data/lib/discorb/intents.rb +161 -163
- data/lib/discorb/interaction/autocomplete.rb +76 -62
- data/lib/discorb/interaction/command.rb +279 -224
- data/lib/discorb/interaction/components.rb +114 -104
- data/lib/discorb/interaction/modal.rb +36 -32
- data/lib/discorb/interaction/response.rb +379 -330
- data/lib/discorb/interaction/root.rb +271 -118
- data/lib/discorb/interaction.rb +5 -5
- data/lib/discorb/invite.rb +154 -153
- data/lib/discorb/member.rb +344 -311
- data/lib/discorb/message.rb +615 -544
- data/lib/discorb/message_meta.rb +197 -186
- data/lib/discorb/modules.rb +371 -290
- data/lib/discorb/permission.rb +305 -289
- data/lib/discorb/presence.rb +352 -346
- data/lib/discorb/rate_limit.rb +81 -76
- data/lib/discorb/reaction.rb +55 -54
- data/lib/discorb/role.rb +272 -240
- data/lib/discorb/shard.rb +76 -74
- data/lib/discorb/sticker.rb +193 -171
- data/lib/discorb/user.rb +205 -188
- data/lib/discorb/utils/colored_puts.rb +16 -16
- data/lib/discorb/utils.rb +12 -16
- data/lib/discorb/voice_state.rb +305 -281
- data/lib/discorb/webhook.rb +537 -507
- data/lib/discorb.rb +62 -56
- data/sig/discorb/activity.rbs +1 -0
- data/sig/discorb/allowed_mentions.rbs +1 -0
- data/sig/discorb/app_command/base.rbs +7 -1
- data/sig/discorb/application.rbs +6 -0
- data/sig/discorb/asset.rbs +2 -0
- data/sig/discorb/attachment.rbs +8 -0
- data/sig/discorb/audit_log.rbs +7 -0
- data/sig/discorb/automod.rbs +32 -6
- data/sig/discorb/avatar.rbs +1 -0
- data/sig/discorb/channel/base.rbs +8 -1
- data/sig/discorb/channel/category.rbs +1 -0
- data/sig/discorb/channel/container.rbs +4 -0
- data/sig/discorb/channel/stage.rbs +4 -0
- data/sig/discorb/channel/text.rbs +2 -2
- data/sig/discorb/channel/thread.rbs +11 -0
- data/sig/discorb/channel/voice.rbs +2 -0
- data/sig/discorb/client.rbs +21 -20
- data/sig/discorb/color.rbs +6 -0
- data/sig/discorb/component/base.rbs +1 -0
- data/sig/discorb/component/button.rbs +2 -0
- data/sig/discorb/component/select_menu.rbs +4 -0
- data/sig/discorb/component/text_input.rbs +1 -0
- data/sig/discorb/custom_emoji.rbs +5 -1
- data/sig/discorb/dictionary.rbs +2 -0
- data/sig/discorb/discord_model.rbs +2 -0
- data/sig/discorb/embed.rbs +7 -0
- data/sig/discorb/emoji.rbs +1 -0
- data/sig/discorb/event_handler.rbs +2 -1
- data/sig/discorb/extension.rbs +13 -12
- data/sig/discorb/flag.rbs +2 -0
- data/sig/discorb/gateway.rbs +5 -0
- data/sig/discorb/guild.rbs +8 -4
- data/sig/discorb/guild_template.rbs +1 -1
- data/sig/discorb/http.rbs +4 -1
- data/sig/discorb/image.rbs +2 -0
- data/sig/discorb/integration.rbs +1 -1
- data/sig/discorb/intents.rbs +4 -3
- data/sig/discorb/interaction/base.rbs +36 -0
- data/sig/discorb/interaction/message_component.rbs +1 -2
- data/sig/discorb/interaction/modal.rbs +1 -2
- data/sig/discorb/interaction/responder.rbs +49 -49
- data/sig/discorb/invite.rbs +1 -1
- data/sig/discorb/member.rbs +2 -0
- data/sig/discorb/message.rbs +8 -1
- data/sig/discorb/messageable.rbs +1 -4
- data/sig/discorb/partial_emoji.rbs +3 -0
- data/sig/discorb/permissions.rbs +7 -0
- data/sig/discorb/presence.rbs +2 -0
- data/sig/discorb/reaction.rbs +5 -1
- data/sig/discorb/role.rbs +7 -1
- data/sig/discorb/scheduled_event.rbs +2 -1
- data/sig/discorb/shard.rbs +2 -1
- data/sig/discorb/snowflake.rbs +2 -0
- data/sig/discorb/stage_instance.rbs +9 -3
- data/sig/discorb/sticker.rbs +1 -1
- data/sig/discorb/unicode_emoji.rbs +4 -0
- data/sig/discorb/user.rbs +24 -20
- data/sig/discorb/webhook.rbs +17 -6
- data/sig/discorb/welcome_screen.rbs +1 -0
- data/sig/override.rbs +2 -0
- metadata +3 -3
|
@@ -12,12 +12,45 @@ module Discorb
|
|
|
12
12
|
# @param [Hash] data The data of the interaction.
|
|
13
13
|
def initialize: (Discorb::Client client, Discorb::json data) -> void
|
|
14
14
|
|
|
15
|
+
%a{pure}
|
|
15
16
|
def guild: -> Discorb::Guild?
|
|
16
17
|
|
|
18
|
+
%a{pure}
|
|
17
19
|
def channel: -> Discorb::Channel
|
|
18
20
|
|
|
21
|
+
%a{pure}
|
|
19
22
|
def inspect: -> String
|
|
20
23
|
|
|
24
|
+
#
|
|
25
|
+
# Edit the original response message.
|
|
26
|
+
# @async
|
|
27
|
+
# @macro edit
|
|
28
|
+
#
|
|
29
|
+
# @param [String] content The new content of the message.
|
|
30
|
+
# @param [Discorb::Embed] embed The new embed of the message.
|
|
31
|
+
# @param [Array<Discorb::Embed>] embeds The new embeds of the message.
|
|
32
|
+
# @param [Array<Discorb::Attachment>] attachments The attachments to remain.
|
|
33
|
+
# @param [Discorb::Attachment] file The file to send.
|
|
34
|
+
# @param [Array<Discorb::Attachment>] files The files to send.
|
|
35
|
+
#
|
|
36
|
+
# @return [Async::Task<void>] The task.
|
|
37
|
+
def edit_original_message: (
|
|
38
|
+
?String? content,
|
|
39
|
+
?embed: Discorb::Embed?,
|
|
40
|
+
?embeds: ::Array[Discorb::Embed]?,
|
|
41
|
+
?attachment: Discorb::Attachment?,
|
|
42
|
+
?attachments: ::Array[Discorb::Attachment]?,
|
|
43
|
+
?components: (::Array[Discorb::Component]
|
|
44
|
+
| ::Array[::Array[Discorb::Component]])?
|
|
45
|
+
) -> Async::Task[void]
|
|
46
|
+
|
|
47
|
+
#
|
|
48
|
+
# Delete the original response message.
|
|
49
|
+
# @async
|
|
50
|
+
#
|
|
51
|
+
# @return [Async::Task<void>] The task.
|
|
52
|
+
def delete_original_message: -> Async::Task[void]
|
|
53
|
+
|
|
21
54
|
#
|
|
22
55
|
# Create a new Interaction instance from the data.
|
|
23
56
|
# @private
|
|
@@ -62,5 +95,8 @@ module Discorb
|
|
|
62
95
|
# @return [Symbol] The locale of the guild that created the interaction.
|
|
63
96
|
# @note This modifies the language code, `-` will be replaced with `_`.
|
|
64
97
|
attr_reader guild_locale: Symbol
|
|
98
|
+
|
|
99
|
+
# @return [Discorb::Permission] The permissions of the bot.
|
|
100
|
+
attr_reader app_permissions: Discorb::Permission
|
|
65
101
|
end
|
|
66
102
|
end
|
|
@@ -107,8 +107,7 @@ module Discorb
|
|
|
107
107
|
?components: (::Array[Discorb::Component]
|
|
108
108
|
| ::Array[::Array[Discorb::Component]])?,
|
|
109
109
|
?ephemeral: bool
|
|
110
|
-
) -> (Discorb::Interaction::
|
|
111
|
-
| Discorb::Webhook::Message)
|
|
110
|
+
) -> (Discorb::Interaction::CallbackMessage | Discorb::Webhook::Message)
|
|
112
111
|
|
|
113
112
|
# @return [String] The content of the response.
|
|
114
113
|
attr_reader custom_id: String
|
|
@@ -38,8 +38,7 @@ module Discorb
|
|
|
38
38
|
?components: (::Array[Discorb::Component]
|
|
39
39
|
| ::Array[::Array[Discorb::Component]])?,
|
|
40
40
|
?ephemeral: bool
|
|
41
|
-
) -> (Discorb::Interaction::
|
|
42
|
-
| Discorb::Webhook::Message)
|
|
41
|
+
) -> (Discorb::Interaction::CallbackMessage | Discorb::Webhook::Message)
|
|
43
42
|
|
|
44
43
|
# @return [String] The custom id of the modal.
|
|
45
44
|
attr_reader custom_id: String
|
|
@@ -41,59 +41,59 @@ module Discorb
|
|
|
41
41
|
?components: (::Array[Discorb::Component]
|
|
42
42
|
| ::Array[::Array[Discorb::Component]])?,
|
|
43
43
|
?ephemeral: bool
|
|
44
|
-
) -> (Discorb::Interaction::
|
|
45
|
-
|
|
44
|
+
) -> (Discorb::Interaction::CallbackMessage | Discorb::Webhook::Message)
|
|
45
|
+
end
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
47
|
+
#
|
|
48
|
+
# Represents of a callback message of interaction.
|
|
49
|
+
class CallbackMessage
|
|
50
|
+
#
|
|
51
|
+
# Initializes a new instance of CallbackMessage.
|
|
52
|
+
# @private
|
|
53
|
+
#
|
|
54
|
+
# @param [Client] client The client.
|
|
55
|
+
# @param [Hash] data The payload.
|
|
56
|
+
# @param [String] application_id The application ID.
|
|
57
|
+
# @param [String] token The token.
|
|
58
|
+
def initialize: (
|
|
59
|
+
Client client,
|
|
60
|
+
Discorb::json data,
|
|
61
|
+
String application_id,
|
|
62
|
+
String token
|
|
63
|
+
) -> void
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
65
|
+
#
|
|
66
|
+
# Edits the callback message.
|
|
67
|
+
# @async
|
|
68
|
+
# @macro edit
|
|
69
|
+
#
|
|
70
|
+
# @param [String] content The new content of the message.
|
|
71
|
+
# @param [Discorb::Embed] embed The new embed of the message.
|
|
72
|
+
# @param [Array<Discorb::Embed>] embeds The new embeds of the message.
|
|
73
|
+
# @param [Array<Discorb::Attachment>] attachments The attachments to remain.
|
|
74
|
+
# @param [Discorb::Attachment] file The file to send.
|
|
75
|
+
# @param [Array<Discorb::Attachment>] files The files to send.
|
|
76
|
+
#
|
|
77
|
+
# @return [Async::Task<void>] The task.
|
|
78
|
+
def edit: (
|
|
79
|
+
?String content,
|
|
80
|
+
?embed: Discorb::Embed,
|
|
81
|
+
?embeds: ::Array[Discorb::Embed],
|
|
82
|
+
?file: Discorb::Attachment,
|
|
83
|
+
?files: ::Array[Discorb::Attachment],
|
|
84
|
+
?attachments: ::Array[Discorb::Attachment]
|
|
85
|
+
) -> Async::Task[void]
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
#
|
|
88
|
+
# Deletes the callback message.
|
|
89
|
+
# @async
|
|
90
|
+
# @note This will fail if the message is ephemeral.
|
|
91
|
+
#
|
|
92
|
+
# @return [Async::Task<void>] The task.
|
|
93
|
+
def delete: -> Async::Task[void]
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
%a{pure}
|
|
96
|
+
def inspect: -> String
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
#
|
data/sig/discorb/invite.rbs
CHANGED
|
@@ -20,7 +20,7 @@ module Discorb
|
|
|
20
20
|
# Delete the invite.
|
|
21
21
|
# @async
|
|
22
22
|
# @return [Async::Task<void>] The task.
|
|
23
|
-
def delete
|
|
23
|
+
def delete: (?reason: String?) -> Async::Task[void]
|
|
24
24
|
|
|
25
25
|
# @return [String] The code of invite.
|
|
26
26
|
attr_reader code: String
|
data/sig/discorb/member.rbs
CHANGED
data/sig/discorb/message.rbs
CHANGED
|
@@ -68,7 +68,7 @@ module Discorb
|
|
|
68
68
|
# @param [String] reason The reason for deleting the message.
|
|
69
69
|
#
|
|
70
70
|
# @return [Async::Task<void>] The task.
|
|
71
|
-
def delete
|
|
71
|
+
def delete: (?reason: String?) -> Async::Task[void]
|
|
72
72
|
|
|
73
73
|
#
|
|
74
74
|
# Convert the message to reference object.
|
|
@@ -171,6 +171,7 @@ module Discorb
|
|
|
171
171
|
) -> Async::Task[Discorb::ThreadChannel]
|
|
172
172
|
|
|
173
173
|
# Meta
|
|
174
|
+
%a{pure}
|
|
174
175
|
def inspect: -> String
|
|
175
176
|
|
|
176
177
|
# @return [Discorb::Snowflake] The ID of the message.
|
|
@@ -343,6 +344,7 @@ module Discorb
|
|
|
343
344
|
# |`1 << 5`|`:has_thread`|
|
|
344
345
|
# |`1 << 6`|`:ephemeral`|
|
|
345
346
|
# |`1 << 7`|`:loading`|
|
|
347
|
+
# |`1 << 8`|`:failed_to_mention_some_roles_in_thread`|
|
|
346
348
|
class Flag < Discorb::Flag
|
|
347
349
|
attr_accessor crossposted: bool
|
|
348
350
|
attr_accessor crosspost: bool
|
|
@@ -352,6 +354,7 @@ module Discorb
|
|
|
352
354
|
attr_accessor has_thread: bool
|
|
353
355
|
attr_accessor ephemeral: bool
|
|
354
356
|
attr_accessor loading: bool
|
|
357
|
+
attr_accessor failed_to_mention_some_roles_in_thread: bool
|
|
355
358
|
end
|
|
356
359
|
|
|
357
360
|
#
|
|
@@ -386,6 +389,7 @@ module Discorb
|
|
|
386
389
|
# @see https://discord.com/developers/docs/resources/channel#message-reference-object
|
|
387
390
|
def self.from_hash: (Discorb::json data) -> Discorb::Message::Reference
|
|
388
391
|
|
|
392
|
+
%a{pure}
|
|
389
393
|
def inspect: -> String
|
|
390
394
|
|
|
391
395
|
# @return [Discorb::Snowflake] The guild ID.
|
|
@@ -406,6 +410,7 @@ module Discorb
|
|
|
406
410
|
class Sticker
|
|
407
411
|
def initialize: (untyped data) -> void
|
|
408
412
|
|
|
413
|
+
%a{pure}
|
|
409
414
|
def inspect: -> String
|
|
410
415
|
|
|
411
416
|
# @return [Discorb::Snowflake] The sticker ID.
|
|
@@ -429,6 +434,7 @@ module Discorb
|
|
|
429
434
|
# @param [Hash] data The interaction data.
|
|
430
435
|
def initialize: (Discorb::Client client, Discorb::json data) -> void
|
|
431
436
|
|
|
437
|
+
%a{pure}
|
|
432
438
|
def inspect: -> String
|
|
433
439
|
|
|
434
440
|
# @return [Discorb::Snowflake] The interaction ID.
|
|
@@ -457,6 +463,7 @@ module Discorb
|
|
|
457
463
|
# @param [Hash] data The activity data.
|
|
458
464
|
def initialize: (Discorb::json data) -> void
|
|
459
465
|
|
|
466
|
+
%a{pure}
|
|
460
467
|
def inspect: -> String
|
|
461
468
|
|
|
462
469
|
# @return [String] The name of activity.
|
data/sig/discorb/messageable.rbs
CHANGED
|
@@ -72,10 +72,7 @@ module Discorb
|
|
|
72
72
|
# @param [String] reason The reason for deleting the message.
|
|
73
73
|
#
|
|
74
74
|
# @return [Async::Task<void>] The task.
|
|
75
|
-
def delete_message
|
|
76
|
-
_ToS message_id,
|
|
77
|
-
?reason: String?
|
|
78
|
-
) -> Async::Task[void]
|
|
75
|
+
def delete_message: (_ToS message_id, ?reason: String?) -> Async::Task[void]
|
|
79
76
|
|
|
80
77
|
#
|
|
81
78
|
# Fetch a message from ID.
|
|
@@ -13,14 +13,17 @@ module Discorb
|
|
|
13
13
|
# Format the emoji for URI.
|
|
14
14
|
#
|
|
15
15
|
# @return [String] the formatted emoji.
|
|
16
|
+
%a{pure}
|
|
16
17
|
def to_uri: -> String
|
|
17
18
|
|
|
19
|
+
%a{pure}
|
|
18
20
|
def inspect: -> String
|
|
19
21
|
|
|
20
22
|
#
|
|
21
23
|
# Format the emoji for sending.
|
|
22
24
|
#
|
|
23
25
|
# @return [String] the formatted emoji.
|
|
26
|
+
%a{pure}
|
|
24
27
|
def to_s: -> String
|
|
25
28
|
|
|
26
29
|
# @return [Discorb::Snowflake] The ID of the emoji.
|
data/sig/discorb/permissions.rbs
CHANGED
|
@@ -91,20 +91,26 @@ module Discorb
|
|
|
91
91
|
# @param deny [Integer] The denied permissions.
|
|
92
92
|
def initialize: (Integer allow, Integer deny) -> void
|
|
93
93
|
|
|
94
|
+
%a{pure}
|
|
94
95
|
def allow: -> Discorb::Permission
|
|
95
96
|
|
|
97
|
+
%a{pure}
|
|
96
98
|
def deny: -> Discorb::Permission
|
|
97
99
|
|
|
100
|
+
%a{pure}
|
|
98
101
|
def allow_value: -> Integer
|
|
99
102
|
|
|
103
|
+
%a{pure}
|
|
100
104
|
def deny_value: -> Integer
|
|
101
105
|
|
|
106
|
+
%a{pure}
|
|
102
107
|
def inspect: -> String
|
|
103
108
|
|
|
104
109
|
#
|
|
105
110
|
# Converts the permission overwrite to a hash.
|
|
106
111
|
#
|
|
107
112
|
# @return [Hash] The permission overwrite as a hash.
|
|
113
|
+
%a{pure}
|
|
108
114
|
def to_hash: -> Hash[Symbol, bool]
|
|
109
115
|
|
|
110
116
|
#
|
|
@@ -121,6 +127,7 @@ module Discorb
|
|
|
121
127
|
# @param [Symbol] field The field to check.
|
|
122
128
|
#
|
|
123
129
|
# @return [true, false, nil] Whether the field is allowed, denied or not set.
|
|
130
|
+
%a{pure}
|
|
124
131
|
def []: (Symbol field) -> bool?
|
|
125
132
|
|
|
126
133
|
#
|
data/sig/discorb/presence.rbs
CHANGED
|
@@ -10,6 +10,7 @@ module Discorb
|
|
|
10
10
|
# @param [Hash] data The data of the presence.
|
|
11
11
|
def initialize: (Discorb::Client client, Discorb::json data) -> void
|
|
12
12
|
|
|
13
|
+
%a{pure}
|
|
13
14
|
def inspect: -> String
|
|
14
15
|
|
|
15
16
|
# @return [:online, :idle, :dnd, :offline] The status of the user.
|
|
@@ -46,6 +47,7 @@ module Discorb
|
|
|
46
47
|
# Convert the activity to a string.
|
|
47
48
|
#
|
|
48
49
|
# @return [String] The string representation of the activity.
|
|
50
|
+
%a{pure}
|
|
49
51
|
def to_s: -> String
|
|
50
52
|
|
|
51
53
|
# @return [String] The name of the activity.
|
data/sig/discorb/reaction.rbs
CHANGED
|
@@ -16,7 +16,11 @@ module Discorb
|
|
|
16
16
|
# @param (see Message#fetch_reacted_users)
|
|
17
17
|
#
|
|
18
18
|
# @return [Async::Task<Array<Discorb::User>>] The users that reacted with this emoji.
|
|
19
|
-
def fetch_users:
|
|
19
|
+
def fetch_users: (
|
|
20
|
+
Discorb::emoji emoji,
|
|
21
|
+
?limit: Integer?,
|
|
22
|
+
?after: Discorb::Snowflake?
|
|
23
|
+
) -> Async::Task[::Array[Discorb::User]]
|
|
20
24
|
|
|
21
25
|
# @return [Integer] The number of users that have reacted with this emoji.
|
|
22
26
|
attr_reader count: Integer
|
data/sig/discorb/role.rbs
CHANGED
|
@@ -17,6 +17,7 @@ module Discorb
|
|
|
17
17
|
Discorb::json data
|
|
18
18
|
) -> void
|
|
19
19
|
|
|
20
|
+
%a{pure}
|
|
20
21
|
def icon: -> (Discorb::Asset | Discorb::emoji | nil)
|
|
21
22
|
|
|
22
23
|
#
|
|
@@ -31,12 +32,16 @@ module Discorb
|
|
|
31
32
|
# Formats the role as a string.
|
|
32
33
|
#
|
|
33
34
|
# @return [String] The formatted string.
|
|
35
|
+
%a{pure}
|
|
34
36
|
def to_s: -> String
|
|
35
37
|
|
|
38
|
+
%a{pure}
|
|
36
39
|
def mention: -> String
|
|
37
40
|
|
|
41
|
+
%a{pure}
|
|
38
42
|
def color?: -> bool
|
|
39
43
|
|
|
44
|
+
%a{pure}
|
|
40
45
|
def inspect: -> String
|
|
41
46
|
|
|
42
47
|
#
|
|
@@ -79,8 +84,9 @@ module Discorb
|
|
|
79
84
|
# @param [String] reason The reason for deleting the role.
|
|
80
85
|
#
|
|
81
86
|
# @return [Async::Task<void>] The task.
|
|
82
|
-
def delete
|
|
87
|
+
def delete: (?reason: String?) -> Async::Task[void]
|
|
83
88
|
|
|
89
|
+
%a{pure}
|
|
84
90
|
def tag: -> Discorb::Role::Tag
|
|
85
91
|
|
|
86
92
|
# @return [Discorb::Snowflake] The ID of the role.
|
|
@@ -57,7 +57,7 @@ module Discorb
|
|
|
57
57
|
# @async
|
|
58
58
|
#
|
|
59
59
|
# @return [Async::Task<void>] The task.
|
|
60
|
-
def delete
|
|
60
|
+
def delete: -> Async::Task[void]
|
|
61
61
|
|
|
62
62
|
#
|
|
63
63
|
# Fetches the event users.
|
|
@@ -139,6 +139,7 @@ module Discorb
|
|
|
139
139
|
# @!visibility private
|
|
140
140
|
def initialize: (untyped data) -> void
|
|
141
141
|
|
|
142
|
+
%a{pure}
|
|
142
143
|
def inspect: -> String
|
|
143
144
|
|
|
144
145
|
# @return [String, nil] The location of the event. Only present if the event is a external event.
|
data/sig/discorb/shard.rbs
CHANGED
data/sig/discorb/snowflake.rbs
CHANGED
|
@@ -15,16 +15,22 @@ module Discorb
|
|
|
15
15
|
?no_cache: bool
|
|
16
16
|
) -> void
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
%a{pure}
|
|
19
|
+
def guild: -> Discorb::Guild
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
%a{pure}
|
|
22
|
+
def channel: -> Discorb::StageChannel
|
|
21
23
|
|
|
24
|
+
%a{pure}
|
|
22
25
|
def discoverable?: -> bool
|
|
23
26
|
|
|
27
|
+
%a{pure}
|
|
24
28
|
def public?: -> bool
|
|
25
29
|
|
|
30
|
+
%a{pure}
|
|
26
31
|
def guild_only?: -> bool
|
|
27
32
|
|
|
33
|
+
%a{pure}
|
|
28
34
|
def inspect: -> String
|
|
29
35
|
|
|
30
36
|
#
|
|
@@ -49,7 +55,7 @@ module Discorb
|
|
|
49
55
|
# @param [String] reason The reason for deleting the stage instance.
|
|
50
56
|
#
|
|
51
57
|
# @return [Async::Task<void>] The task.
|
|
52
|
-
def delete
|
|
58
|
+
def delete: (?reason: String?) -> Async::Task[void]
|
|
53
59
|
|
|
54
60
|
# @return [Discorb::Snowflake] The ID of the guild this voice state is for.
|
|
55
61
|
attr_reader id: Discorb::Snowflake
|
data/sig/discorb/sticker.rbs
CHANGED
|
@@ -10,14 +10,17 @@ module Discorb
|
|
|
10
10
|
def initialize: (String name, ?tone: Integer) -> void
|
|
11
11
|
|
|
12
12
|
# @return [String] The unicode string of the emoji.
|
|
13
|
+
%a{pure}
|
|
13
14
|
def to_s: -> String
|
|
14
15
|
|
|
15
16
|
#
|
|
16
17
|
# Format the emoji for URI.
|
|
17
18
|
#
|
|
18
19
|
# @return [String] the formatted emoji.
|
|
20
|
+
%a{pure}
|
|
19
21
|
def to_uri: -> String
|
|
20
22
|
|
|
23
|
+
%a{pure}
|
|
21
24
|
def inspect: -> String
|
|
22
25
|
|
|
23
26
|
#
|
|
@@ -25,6 +28,7 @@ module Discorb
|
|
|
25
28
|
# @private
|
|
26
29
|
#
|
|
27
30
|
# @return [Hash] The hash represents the object.
|
|
31
|
+
%a{pure}
|
|
28
32
|
def to_hash: -> Discorb::json
|
|
29
33
|
|
|
30
34
|
# @return [String] The name of the emoji. (e.g. :grinning:)
|
data/sig/discorb/user.rbs
CHANGED
|
@@ -16,8 +16,10 @@ module Discorb
|
|
|
16
16
|
# Format the user as `Username#Discriminator` style.
|
|
17
17
|
#
|
|
18
18
|
# @return [String] The formatted username.
|
|
19
|
+
%a{pure}
|
|
19
20
|
def to_s: -> String
|
|
20
21
|
|
|
22
|
+
%a{pure}
|
|
21
23
|
def inspect: -> String
|
|
22
24
|
|
|
23
25
|
#
|
|
@@ -61,33 +63,35 @@ module Discorb
|
|
|
61
63
|
#
|
|
62
64
|
# Represents the user's flags.
|
|
63
65
|
# ## Flag fields
|
|
64
|
-
# |`1 << 0`|`:
|
|
65
|
-
# |`1 << 1`|`:
|
|
66
|
-
# |`1 << 2`|`:
|
|
66
|
+
# |`1 << 0`|`:staff`|
|
|
67
|
+
# |`1 << 1`|`:partner`|
|
|
68
|
+
# |`1 << 2`|`:hypesquad`|
|
|
67
69
|
# |`1 << 3`|`:bug_hunter_level_1`|
|
|
68
|
-
# |`1 << 6`|`:
|
|
69
|
-
# |`1 << 7`|`:
|
|
70
|
-
# |`1 << 8`|`:
|
|
71
|
-
# |`1 << 9`|`:
|
|
72
|
-
# |`1 << 10`|`:
|
|
70
|
+
# |`1 << 6`|`:hypesquad_online_house_1`|
|
|
71
|
+
# |`1 << 7`|`:hypesquad_online_house_2`|
|
|
72
|
+
# |`1 << 8`|`:hypesquad_online_house_3`|
|
|
73
|
+
# |`1 << 9`|`:premium_early_supporter`|
|
|
74
|
+
# |`1 << 10`|`:team_psuedo_user`|
|
|
73
75
|
# |`1 << 14`|`:bug_hunter_level_2`|
|
|
74
76
|
# |`1 << 16`|`:verified_bot`|
|
|
75
|
-
# |`1 << 17`|`:
|
|
76
|
-
# |`1 << 18`|`:
|
|
77
|
+
# |`1 << 17`|`:verified_developer`|
|
|
78
|
+
# |`1 << 18`|`:certified_moderator`|
|
|
79
|
+
# |`1 << 19`|`:bot_http_interactions`|
|
|
77
80
|
class Flag < Discorb::Flag
|
|
78
|
-
attr_accessor
|
|
79
|
-
attr_accessor
|
|
80
|
-
attr_accessor
|
|
81
|
+
attr_accessor staff: bool
|
|
82
|
+
attr_accessor partner: bool
|
|
83
|
+
attr_accessor hypesquad: bool
|
|
81
84
|
attr_accessor bug_hunter_level_1: bool
|
|
82
|
-
attr_accessor
|
|
83
|
-
attr_accessor
|
|
84
|
-
attr_accessor
|
|
85
|
-
attr_accessor
|
|
86
|
-
attr_accessor
|
|
85
|
+
attr_accessor hypesquad_online_house_1: bool
|
|
86
|
+
attr_accessor hypesquad_online_house_2: bool
|
|
87
|
+
attr_accessor hypesquad_online_house_3: bool
|
|
88
|
+
attr_accessor premium_early_supporter: bool
|
|
89
|
+
attr_accessor team_psuedo_user: bool
|
|
87
90
|
attr_accessor bug_hunter_level_2: bool
|
|
88
91
|
attr_accessor verified_bot: bool
|
|
89
|
-
attr_accessor
|
|
90
|
-
attr_accessor
|
|
92
|
+
attr_accessor verified_developer: bool
|
|
93
|
+
attr_accessor certified_moderator: bool
|
|
94
|
+
attr_accessor bot_http_interactions: bool
|
|
91
95
|
end
|
|
92
96
|
end
|
|
93
97
|
end
|
data/sig/discorb/webhook.rbs
CHANGED
|
@@ -11,6 +11,7 @@ module Discorb
|
|
|
11
11
|
# @param [Hash] data The data of the webhook.
|
|
12
12
|
def initialize: (Discorb::Client client, Discorb::json data) -> void
|
|
13
13
|
|
|
14
|
+
%a{pure}
|
|
14
15
|
def inspect: -> String
|
|
15
16
|
|
|
16
17
|
#
|
|
@@ -64,7 +65,7 @@ module Discorb
|
|
|
64
65
|
# @async
|
|
65
66
|
#
|
|
66
67
|
# @return [Async::Task<void>] The task.
|
|
67
|
-
def delete
|
|
68
|
+
def delete: -> Async::Task[void]
|
|
68
69
|
|
|
69
70
|
#
|
|
70
71
|
# Edits the webhook's message.
|
|
@@ -98,9 +99,7 @@ module Discorb
|
|
|
98
99
|
# @param [Discorb::Webhook::Message] message The message to delete.
|
|
99
100
|
#
|
|
100
101
|
# @return [Async::Task<void>] The task.
|
|
101
|
-
def delete_message
|
|
102
|
-
Discorb::Webhook::Message message
|
|
103
|
-
) -> Async::Task[void]
|
|
102
|
+
def delete_message: (Discorb::Webhook::Message message) -> Async::Task[void]
|
|
104
103
|
|
|
105
104
|
#
|
|
106
105
|
# Creates URLWebhook.
|
|
@@ -209,6 +208,7 @@ module Discorb
|
|
|
209
208
|
# @param [Hash] data The data of the guild.
|
|
210
209
|
def initialize: (Discorb::json data) -> void
|
|
211
210
|
|
|
211
|
+
%a{pure}
|
|
212
212
|
def inspect: -> String
|
|
213
213
|
|
|
214
214
|
# @return [Discorb::Snowflake] The ID of the guild.
|
|
@@ -231,6 +231,7 @@ module Discorb
|
|
|
231
231
|
# @param [Hash] data The data of the channel.
|
|
232
232
|
def initialize: (Discorb::json data) -> void
|
|
233
233
|
|
|
234
|
+
%a{pure}
|
|
234
235
|
def inspect: -> String
|
|
235
236
|
|
|
236
237
|
# @return [Discorb::Snowflake] The ID of the channel.
|
|
@@ -272,14 +273,22 @@ module Discorb
|
|
|
272
273
|
# @param (see Webhook#edit_message)
|
|
273
274
|
#
|
|
274
275
|
# @return [Async::Task<void>] The task.
|
|
275
|
-
def edit:
|
|
276
|
+
def edit: (
|
|
277
|
+
?String content,
|
|
278
|
+
?embed: Discorb::Embed,
|
|
279
|
+
?embeds: ::Array[Discorb::Embed],
|
|
280
|
+
?file: Discorb::Attachment,
|
|
281
|
+
?files: ::Array[Discorb::Attachment],
|
|
282
|
+
?attachments: ::Array[Discorb::Attachment],
|
|
283
|
+
?allowed_mentions: Discorb::AllowedMentions
|
|
284
|
+
) -> Async::Task[void]
|
|
276
285
|
|
|
277
286
|
#
|
|
278
287
|
# Deletes the message.
|
|
279
288
|
# @async
|
|
280
289
|
#
|
|
281
290
|
# @return [Async::Task<void>] The task.
|
|
282
|
-
def delete
|
|
291
|
+
def delete: -> Async::Task[void]
|
|
283
292
|
|
|
284
293
|
# @return [Discorb::Snowflake] The ID of the channel.
|
|
285
294
|
attr_reader channel_id: Discorb::Snowflake
|
|
@@ -301,8 +310,10 @@ module Discorb
|
|
|
301
310
|
# Format author with `Name#Discriminator` style.
|
|
302
311
|
#
|
|
303
312
|
# @return [String] Formatted author.
|
|
313
|
+
%a{pure}
|
|
304
314
|
def to_s: -> String
|
|
305
315
|
|
|
316
|
+
%a{pure}
|
|
306
317
|
def inspect: -> String
|
|
307
318
|
|
|
308
319
|
# @return [Boolean] Whether the author is a bot.
|