discorb 0.18.1 → 0.19.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/Changelog.md +9 -0
- data/Gemfile +4 -4
- data/Rakefile +17 -22
- data/Steepfile +8 -6
- data/docs/events.md +2 -2
- data/docs/voice_events.md +6 -6
- data/lib/discorb/automod.rb +1 -1
- data/lib/discorb/channel/guild.rb +3 -3
- data/lib/discorb/channel/text.rb +3 -3
- data/lib/discorb/client.rb +4 -6
- data/lib/discorb/common.rb +1 -1
- data/lib/discorb/embed.rb +1 -1
- data/lib/discorb/emoji.rb +2 -2
- data/lib/discorb/event.rb +2 -2
- data/lib/discorb/gateway.rb +17 -7
- data/lib/discorb/guild.rb +4 -4
- data/lib/discorb/guild_template.rb +2 -2
- data/lib/discorb/integration.rb +2 -2
- data/lib/discorb/interaction/response.rb +83 -77
- data/lib/discorb/interaction/root.rb +136 -0
- data/lib/discorb/invite.rb +1 -1
- data/lib/discorb/message.rb +4 -4
- data/lib/discorb/modules.rb +2 -2
- data/lib/discorb/permission.rb +3 -1
- data/lib/discorb/role.rb +2 -2
- data/lib/discorb/shard.rb +1 -1
- data/lib/discorb/sticker.rb +2 -2
- data/lib/discorb/voice_state.rb +3 -3
- data/lib/discorb/webhook.rb +5 -5
- data/sig/discorb/activity.rbs +1 -0
- data/sig/discorb/allowed_mentions.rbs +1 -0
- data/sig/discorb/app_command/base.rbs +6 -0
- data/sig/discorb/application.rbs +4 -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 +22 -5
- 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 +6 -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 +33 -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 +6 -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 +2 -0
- data/sig/discorb/webhook.rbs +17 -6
- data/sig/discorb/welcome_screen.rbs +1 -0
- data/sig/override.rbs +2 -0
- metadata +3 -3
|
@@ -34,7 +34,7 @@ module Discorb
|
|
|
34
34
|
?rate_limit_per_user: Integer,
|
|
35
35
|
?slowmode: Integer,
|
|
36
36
|
?default_auto_archive_duration: 60 | 1440 | 4320 | 10080,
|
|
37
|
-
?archive_in:
|
|
37
|
+
?archive_in: 60 | 1440 | 4320 | 10080,
|
|
38
38
|
?reason: String?
|
|
39
39
|
) -> Async::Task[self]
|
|
40
40
|
|
|
@@ -66,7 +66,7 @@ module Discorb
|
|
|
66
66
|
# @param [Boolean] force Whether to ignore the validation for message (14 days limit).
|
|
67
67
|
#
|
|
68
68
|
# @return [Async::Task<void>] The task.
|
|
69
|
-
def delete_messages
|
|
69
|
+
def delete_messages:
|
|
70
70
|
(*Discorb::Message messages, ?force: bool) -> Async::Task[void]
|
|
71
71
|
| (*Array[Discorb::Message] messages, ?force: bool) -> Async::Task[void]
|
|
72
72
|
|
|
@@ -79,16 +79,22 @@ module Discorb
|
|
|
79
79
|
# @note This method won't unarchive the thread. Use {#unarchive} instead.
|
|
80
80
|
def unlock: (?reason: String?) -> Async::Task[self]
|
|
81
81
|
|
|
82
|
+
%a{pure}
|
|
82
83
|
def parent: -> untyped
|
|
83
84
|
|
|
85
|
+
%a{pure}
|
|
84
86
|
def me: -> untyped
|
|
85
87
|
|
|
88
|
+
%a{pure}
|
|
86
89
|
def joined?: -> bool
|
|
87
90
|
|
|
91
|
+
%a{pure}
|
|
88
92
|
def guild: -> untyped
|
|
89
93
|
|
|
94
|
+
%a{pure}
|
|
90
95
|
def owner: -> untyped
|
|
91
96
|
|
|
97
|
+
%a{pure}
|
|
92
98
|
def inspect: -> String
|
|
93
99
|
|
|
94
100
|
#
|
|
@@ -168,14 +174,19 @@ module Discorb
|
|
|
168
174
|
_ToS guild_id
|
|
169
175
|
) -> void
|
|
170
176
|
|
|
177
|
+
%a{pure}
|
|
171
178
|
def thread: -> Discorb::ThreadChannel
|
|
172
179
|
|
|
180
|
+
%a{pure}
|
|
173
181
|
def member: -> Discorb::Member
|
|
174
182
|
|
|
183
|
+
%a{pure}
|
|
175
184
|
def id: -> Discorb::Snowflake
|
|
176
185
|
|
|
186
|
+
%a{pure}
|
|
177
187
|
def user: -> Discorb::User
|
|
178
188
|
|
|
189
|
+
%a{pure}
|
|
179
190
|
def inspect: -> String
|
|
180
191
|
|
|
181
192
|
# Returns the value of attribute joined_at.
|
data/sig/discorb/client.rbs
CHANGED
|
@@ -464,7 +464,7 @@ module Discorb
|
|
|
464
464
|
(Discorb::MessageComponentInteraction::SelectMenu interaction) -> void
|
|
465
465
|
} -> Discorb::EventHandler
|
|
466
466
|
| (
|
|
467
|
-
:
|
|
467
|
+
:modal_submit event_name,
|
|
468
468
|
?id: Symbol?,
|
|
469
469
|
**untyped metadata
|
|
470
470
|
) {
|
|
@@ -566,28 +566,28 @@ module Discorb
|
|
|
566
566
|
?id: Symbol?,
|
|
567
567
|
**untyped metadata
|
|
568
568
|
) {
|
|
569
|
-
-> void
|
|
569
|
+
(Discorb::VoiceState state) -> void
|
|
570
570
|
} -> Discorb::EventHandler
|
|
571
571
|
| (
|
|
572
572
|
:voice_channel_disconnect event_name,
|
|
573
573
|
?id: Symbol?,
|
|
574
574
|
**untyped metadata
|
|
575
575
|
) {
|
|
576
|
-
-> void
|
|
576
|
+
(Discorb::VoiceState state) -> void
|
|
577
577
|
} -> Discorb::EventHandler
|
|
578
578
|
| (
|
|
579
579
|
:voice_channel_move event_name,
|
|
580
580
|
?id: Symbol?,
|
|
581
581
|
**untyped metadata
|
|
582
582
|
) {
|
|
583
|
-
-> void
|
|
583
|
+
(Discorb::VoiceState before, Discorb::VoiceState after) -> void
|
|
584
584
|
} -> Discorb::EventHandler
|
|
585
585
|
| (
|
|
586
586
|
:voice_channel_update event_name,
|
|
587
587
|
?id: Symbol?,
|
|
588
588
|
**untyped metadata
|
|
589
589
|
) {
|
|
590
|
-
-> void
|
|
590
|
+
(Discorb::VoiceState before, Discorb::VoiceState after) -> void
|
|
591
591
|
} -> Discorb::EventHandler
|
|
592
592
|
| (
|
|
593
593
|
:voice_mute_disable event_name,
|
|
@@ -1226,7 +1226,7 @@ module Discorb
|
|
|
1226
1226
|
(Discorb::MessageComponentInteraction::SelectMenu interaction) -> void
|
|
1227
1227
|
} -> Discorb::EventHandler
|
|
1228
1228
|
| (
|
|
1229
|
-
:
|
|
1229
|
+
:modal_submit event_name,
|
|
1230
1230
|
?id: Symbol?,
|
|
1231
1231
|
**untyped metadata
|
|
1232
1232
|
) {
|
|
@@ -1328,28 +1328,28 @@ module Discorb
|
|
|
1328
1328
|
?id: Symbol?,
|
|
1329
1329
|
**untyped metadata
|
|
1330
1330
|
) {
|
|
1331
|
-
-> void
|
|
1331
|
+
(Discorb::VoiceState state) -> void
|
|
1332
1332
|
} -> Discorb::EventHandler
|
|
1333
1333
|
| (
|
|
1334
1334
|
:voice_channel_disconnect event_name,
|
|
1335
1335
|
?id: Symbol?,
|
|
1336
1336
|
**untyped metadata
|
|
1337
1337
|
) {
|
|
1338
|
-
-> void
|
|
1338
|
+
(Discorb::VoiceState state) -> void
|
|
1339
1339
|
} -> Discorb::EventHandler
|
|
1340
1340
|
| (
|
|
1341
1341
|
:voice_channel_move event_name,
|
|
1342
1342
|
?id: Symbol?,
|
|
1343
1343
|
**untyped metadata
|
|
1344
1344
|
) {
|
|
1345
|
-
-> void
|
|
1345
|
+
(Discorb::VoiceState before, Discorb::VoiceState after) -> void
|
|
1346
1346
|
} -> Discorb::EventHandler
|
|
1347
1347
|
| (
|
|
1348
1348
|
:voice_channel_update event_name,
|
|
1349
1349
|
?id: Symbol?,
|
|
1350
1350
|
**untyped metadata
|
|
1351
1351
|
) {
|
|
1352
|
-
-> void
|
|
1352
|
+
(Discorb::VoiceState before, Discorb::VoiceState after) -> void
|
|
1353
1353
|
} -> Discorb::EventHandler
|
|
1354
1354
|
| (
|
|
1355
1355
|
:voice_mute_disable event_name,
|
|
@@ -2012,7 +2012,7 @@ module Discorb
|
|
|
2012
2012
|
) -> boolish
|
|
2013
2013
|
} -> Async::Task[Discorb::MessageComponentInteraction::SelectMenu]
|
|
2014
2014
|
| (
|
|
2015
|
-
:
|
|
2015
|
+
:modal_submit event,
|
|
2016
2016
|
?Integer? timeout
|
|
2017
2017
|
) {
|
|
2018
2018
|
(Discorb::ModalInteraction interaction) -> boolish
|
|
@@ -2105,26 +2105,26 @@ module Discorb
|
|
|
2105
2105
|
:voice_channel_connect event,
|
|
2106
2106
|
?Integer? timeout
|
|
2107
2107
|
) {
|
|
2108
|
-
-> boolish
|
|
2109
|
-
} -> Async::Task[
|
|
2108
|
+
(Discorb::VoiceState state) -> boolish
|
|
2109
|
+
} -> Async::Task[Discorb::VoiceState]
|
|
2110
2110
|
| (
|
|
2111
2111
|
:voice_channel_disconnect event,
|
|
2112
2112
|
?Integer? timeout
|
|
2113
2113
|
) {
|
|
2114
|
-
-> boolish
|
|
2115
|
-
} -> Async::Task[
|
|
2114
|
+
(Discorb::VoiceState state) -> boolish
|
|
2115
|
+
} -> Async::Task[Discorb::VoiceState]
|
|
2116
2116
|
| (
|
|
2117
2117
|
:voice_channel_move event,
|
|
2118
2118
|
?Integer? timeout
|
|
2119
2119
|
) {
|
|
2120
|
-
-> boolish
|
|
2121
|
-
} -> Async::Task[
|
|
2120
|
+
(Discorb::VoiceState before, Discorb::VoiceState after) -> boolish
|
|
2121
|
+
} -> Async::Task[[Discorb::VoiceState, Discorb::VoiceState]]
|
|
2122
2122
|
| (
|
|
2123
2123
|
:voice_channel_update event,
|
|
2124
2124
|
?Integer? timeout
|
|
2125
2125
|
) {
|
|
2126
|
-
-> boolish
|
|
2127
|
-
} -> Async::Task[
|
|
2126
|
+
(Discorb::VoiceState before, Discorb::VoiceState after) -> boolish
|
|
2127
|
+
} -> Async::Task[[Discorb::VoiceState, Discorb::VoiceState]]
|
|
2128
2128
|
| (
|
|
2129
2129
|
:voice_mute_disable event,
|
|
2130
2130
|
?Integer? timeout
|
|
@@ -2300,6 +2300,7 @@ module Discorb
|
|
|
2300
2300
|
(*untyped) -> boolish
|
|
2301
2301
|
} -> Async::Task[untyped]
|
|
2302
2302
|
|
|
2303
|
+
%a{pure}
|
|
2303
2304
|
def inspect: -> String
|
|
2304
2305
|
|
|
2305
2306
|
#
|
|
@@ -2321,7 +2322,7 @@ module Discorb
|
|
|
2321
2322
|
|
|
2322
2323
|
#
|
|
2323
2324
|
# Stops the client.
|
|
2324
|
-
def close
|
|
2325
|
+
def close: -> void
|
|
2325
2326
|
|
|
2326
2327
|
private
|
|
2327
2328
|
|
data/sig/discorb/color.rbs
CHANGED
|
@@ -12,18 +12,21 @@ module Discorb
|
|
|
12
12
|
# Integerize a color.
|
|
13
13
|
#
|
|
14
14
|
# @return [Integer] A color value.
|
|
15
|
+
%a{pure}
|
|
15
16
|
def to_i: -> Integer
|
|
16
17
|
|
|
17
18
|
#
|
|
18
19
|
# Convert a color to a hexadecimal value.
|
|
19
20
|
#
|
|
20
21
|
# @return [String] A hexadecimal value.
|
|
22
|
+
%a{pure}
|
|
21
23
|
def to_hex: -> String
|
|
22
24
|
|
|
23
25
|
#
|
|
24
26
|
# Convert a color to RGB array.
|
|
25
27
|
#
|
|
26
28
|
# @return [Array(Integer, Integer, Integer)] A RGB array.
|
|
29
|
+
%a{pure}
|
|
27
30
|
def to_rgb: -> [Integer, Integer, Integer]
|
|
28
31
|
|
|
29
32
|
alias to_a to_rgb
|
|
@@ -33,6 +36,7 @@ module Discorb
|
|
|
33
36
|
# Convert a color to RGB hash.
|
|
34
37
|
#
|
|
35
38
|
# @return [Hash{:r, :g, :b => Integer}] A RGB hash.
|
|
39
|
+
%a{pure}
|
|
36
40
|
def to_rgb_hash: -> { r: Integer, g: Integer, b: Integer }
|
|
37
41
|
|
|
38
42
|
alias deconstruct_keys to_rgb_hash
|
|
@@ -41,8 +45,10 @@ module Discorb
|
|
|
41
45
|
# Converts a color to a `#000000` string.
|
|
42
46
|
#
|
|
43
47
|
# @return [String] Converted string.
|
|
48
|
+
%a{pure}
|
|
44
49
|
def to_s: -> String
|
|
45
50
|
|
|
51
|
+
%a{pure}
|
|
46
52
|
def inspect: -> String
|
|
47
53
|
|
|
48
54
|
#
|
|
@@ -28,8 +28,10 @@ module Discorb
|
|
|
28
28
|
# @see https://discord.com/developers/docs/interactions/message-components#button-object-button-structure
|
|
29
29
|
# Official Discord API docs
|
|
30
30
|
# @return [Hash] A hash representation of the button.
|
|
31
|
+
%a{pure}
|
|
31
32
|
def to_hash: -> Discorb::json
|
|
32
33
|
|
|
34
|
+
%a{pure}
|
|
33
35
|
def inspect: -> String
|
|
34
36
|
|
|
35
37
|
#
|
|
@@ -24,8 +24,10 @@ module Discorb
|
|
|
24
24
|
# @see https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-menu-structure
|
|
25
25
|
# Official Discord API docs
|
|
26
26
|
# @return [Hash] A hash representation of the select menu.
|
|
27
|
+
%a{pure}
|
|
27
28
|
def to_hash: -> Discorb::json
|
|
28
29
|
|
|
30
|
+
%a{pure}
|
|
29
31
|
def inspect: -> String
|
|
30
32
|
|
|
31
33
|
#
|
|
@@ -76,8 +78,10 @@ module Discorb
|
|
|
76
78
|
# @see https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure
|
|
77
79
|
# Official Discord API docs
|
|
78
80
|
# @return [Hash] Hash representation of the option.
|
|
81
|
+
%a{pure}
|
|
79
82
|
def to_hash: -> Discorb::json
|
|
80
83
|
|
|
84
|
+
%a{pure}
|
|
81
85
|
def inspect: -> String
|
|
82
86
|
|
|
83
87
|
#
|
|
@@ -32,6 +32,7 @@ module Discorb
|
|
|
32
32
|
# @see https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-structure
|
|
33
33
|
# Official Discord API docs
|
|
34
34
|
# @return [Hash] A hash representation of the text input.
|
|
35
|
+
%a{pure}
|
|
35
36
|
def to_hash: -> Discorb::json
|
|
36
37
|
|
|
37
38
|
#
|
|
@@ -18,14 +18,17 @@ module Discorb
|
|
|
18
18
|
# Format the emoji for sending.
|
|
19
19
|
#
|
|
20
20
|
# @return [String] the formatted emoji.
|
|
21
|
+
%a{pure}
|
|
21
22
|
def to_s: -> String
|
|
22
23
|
|
|
23
24
|
#
|
|
24
25
|
# Format the emoji for URI.
|
|
25
26
|
#
|
|
26
27
|
# @return [String] the formatted emoji.
|
|
28
|
+
%a{pure}
|
|
27
29
|
def to_uri: -> String
|
|
28
30
|
|
|
31
|
+
%a{pure}
|
|
29
32
|
def inspect: -> String
|
|
30
33
|
|
|
31
34
|
#
|
|
@@ -51,13 +54,14 @@ module Discorb
|
|
|
51
54
|
# @param [String] reason The reason for deleting the emoji.
|
|
52
55
|
#
|
|
53
56
|
# @return [Async::Task<self>] The deleted emoji.
|
|
54
|
-
def delete
|
|
57
|
+
def delete: (?reason: String?) -> Async::Task[self]
|
|
55
58
|
|
|
56
59
|
#
|
|
57
60
|
# Converts the object to a hash.
|
|
58
61
|
# @private
|
|
59
62
|
#
|
|
60
63
|
# @return [Hash] The hash represents the object.
|
|
64
|
+
%a{pure}
|
|
61
65
|
def to_hash: -> Discorb::json
|
|
62
66
|
|
|
63
67
|
# @return [Discorb::Snowflake] The ID of the emoji.
|
data/sig/discorb/dictionary.rbs
CHANGED
|
@@ -57,6 +57,7 @@ module Discorb
|
|
|
57
57
|
# Returns the values of the dictionary.
|
|
58
58
|
#
|
|
59
59
|
# @return [Array] The values of the dictionary.
|
|
60
|
+
%a{pure}
|
|
60
61
|
def values: -> ::Array[V]
|
|
61
62
|
|
|
62
63
|
#
|
|
@@ -77,6 +78,7 @@ module Discorb
|
|
|
77
78
|
untyped kwargs
|
|
78
79
|
) -> bool
|
|
79
80
|
|
|
81
|
+
%a{pure}
|
|
80
82
|
def inspect: -> String
|
|
81
83
|
|
|
82
84
|
# @return [Integer] The maximum number of items in the dictionary.
|
data/sig/discorb/embed.rbs
CHANGED
|
@@ -35,6 +35,7 @@ module Discorb
|
|
|
35
35
|
# @param [Hash] data The hash data to initialize embed.
|
|
36
36
|
def initialize_hash: (Discorb::json data) -> untyped
|
|
37
37
|
|
|
38
|
+
%a{pure}
|
|
38
39
|
def inspect: -> String
|
|
39
40
|
|
|
40
41
|
#
|
|
@@ -42,6 +43,7 @@ module Discorb
|
|
|
42
43
|
#
|
|
43
44
|
# @see https://discord.com/developers/docs/resources/channel#embed-object-embed-structure Offical Discord API Docs
|
|
44
45
|
# @return [Hash] Converted embed.
|
|
46
|
+
%a{pure}
|
|
45
47
|
def to_hash: -> Discorb::json
|
|
46
48
|
|
|
47
49
|
def self.from_hash: (untyped data) -> untyped
|
|
@@ -84,6 +86,7 @@ module Discorb
|
|
|
84
86
|
# @abstract
|
|
85
87
|
# @private
|
|
86
88
|
class Entry
|
|
89
|
+
%a{pure}
|
|
87
90
|
def inspect: -> String
|
|
88
91
|
end
|
|
89
92
|
|
|
@@ -132,6 +135,7 @@ module Discorb
|
|
|
132
135
|
# @see https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure
|
|
133
136
|
# Offical Discord API Docs
|
|
134
137
|
# @return [Hash] Converted footer.
|
|
138
|
+
%a{pure}
|
|
135
139
|
def to_hash: -> Discorb::json
|
|
136
140
|
|
|
137
141
|
# Returns the value of attribute text.
|
|
@@ -158,6 +162,7 @@ module Discorb
|
|
|
158
162
|
# @see https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
|
|
159
163
|
# Offical Discord API Docs
|
|
160
164
|
# @return [Hash] Converted field.
|
|
165
|
+
%a{pure}
|
|
161
166
|
def to_hash: -> Discorb::json
|
|
162
167
|
|
|
163
168
|
# @return [String] The name of field.
|
|
@@ -185,6 +190,7 @@ module Discorb
|
|
|
185
190
|
# @see https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
|
|
186
191
|
# Offical Discord API Docs
|
|
187
192
|
# @return [Hash] Converted image.
|
|
193
|
+
%a{pure}
|
|
188
194
|
def to_hash: -> Discorb::json
|
|
189
195
|
|
|
190
196
|
# @return [String] The url of image.
|
|
@@ -218,6 +224,7 @@ module Discorb
|
|
|
218
224
|
# @see https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
|
|
219
225
|
# Offical Discord API Docs
|
|
220
226
|
# @return [Hash] Converted thumbnail.
|
|
227
|
+
%a{pure}
|
|
221
228
|
def to_hash: -> Discorb::json
|
|
222
229
|
|
|
223
230
|
# @return [String] The url of thumbnail.
|
data/sig/discorb/emoji.rbs
CHANGED
|
@@ -6,11 +6,12 @@ module Discorb
|
|
|
6
6
|
class EventHandler
|
|
7
7
|
def initialize: (untyped block, Symbol? id, untyped metadata) -> void
|
|
8
8
|
|
|
9
|
+
%a{pure}
|
|
9
10
|
def inspect: -> String
|
|
10
11
|
|
|
11
12
|
#
|
|
12
13
|
# Calls the block associated with the event.
|
|
13
|
-
def call: -> untyped
|
|
14
|
+
def call: (*untyped, **untyped) ?{ (*untyped) -> untyped } -> untyped
|
|
14
15
|
|
|
15
16
|
# @return [Proc] the block to be called.
|
|
16
17
|
attr_reader block: ^(*untyped) -> void
|
data/sig/discorb/extension.rbs
CHANGED
|
@@ -7,6 +7,7 @@ module Discorb
|
|
|
7
7
|
module Extension
|
|
8
8
|
def initialize: (untyped client) -> void
|
|
9
9
|
|
|
10
|
+
%a{pure}
|
|
10
11
|
def events: -> untyped
|
|
11
12
|
|
|
12
13
|
def self.included: (untyped base) -> untyped
|
|
@@ -452,7 +453,7 @@ module Discorb
|
|
|
452
453
|
(Discorb::MessageComponentInteraction::SelectMenu interaction) -> void
|
|
453
454
|
} -> void
|
|
454
455
|
| (
|
|
455
|
-
:
|
|
456
|
+
:modal_submit event_name,
|
|
456
457
|
?id: Symbol?,
|
|
457
458
|
**untyped metadata
|
|
458
459
|
) {
|
|
@@ -560,28 +561,28 @@ module Discorb
|
|
|
560
561
|
?id: Symbol?,
|
|
561
562
|
**untyped metadata
|
|
562
563
|
) {
|
|
563
|
-
-> void
|
|
564
|
+
(Discorb::VoiceState state) -> void
|
|
564
565
|
} -> void
|
|
565
566
|
| (
|
|
566
567
|
:voice_channel_disconnect event_name,
|
|
567
568
|
?id: Symbol?,
|
|
568
569
|
**untyped metadata
|
|
569
570
|
) {
|
|
570
|
-
-> void
|
|
571
|
+
(Discorb::VoiceState state) -> void
|
|
571
572
|
} -> void
|
|
572
573
|
| (
|
|
573
574
|
:voice_channel_move event_name,
|
|
574
575
|
?id: Symbol?,
|
|
575
576
|
**untyped metadata
|
|
576
577
|
) {
|
|
577
|
-
-> void
|
|
578
|
+
(Discorb::VoiceState before, Discorb::VoiceState after) -> void
|
|
578
579
|
} -> void
|
|
579
580
|
| (
|
|
580
581
|
:voice_channel_update event_name,
|
|
581
582
|
?id: Symbol?,
|
|
582
583
|
**untyped metadata
|
|
583
584
|
) {
|
|
584
|
-
-> void
|
|
585
|
+
(Discorb::VoiceState before, Discorb::VoiceState after) -> void
|
|
585
586
|
} -> void
|
|
586
587
|
| (
|
|
587
588
|
:voice_mute_disable event_name,
|
|
@@ -1223,7 +1224,7 @@ module Discorb
|
|
|
1223
1224
|
(Discorb::MessageComponentInteraction::SelectMenu interaction) -> void
|
|
1224
1225
|
} -> void
|
|
1225
1226
|
| (
|
|
1226
|
-
:
|
|
1227
|
+
:modal_submit event_name,
|
|
1227
1228
|
?id: Symbol?,
|
|
1228
1229
|
**untyped metadata
|
|
1229
1230
|
) {
|
|
@@ -1331,28 +1332,28 @@ module Discorb
|
|
|
1331
1332
|
?id: Symbol?,
|
|
1332
1333
|
**untyped metadata
|
|
1333
1334
|
) {
|
|
1334
|
-
-> void
|
|
1335
|
+
(Discorb::VoiceState state) -> void
|
|
1335
1336
|
} -> void
|
|
1336
1337
|
| (
|
|
1337
1338
|
:voice_channel_disconnect event_name,
|
|
1338
1339
|
?id: Symbol?,
|
|
1339
1340
|
**untyped metadata
|
|
1340
1341
|
) {
|
|
1341
|
-
-> void
|
|
1342
|
+
(Discorb::VoiceState state) -> void
|
|
1342
1343
|
} -> void
|
|
1343
1344
|
| (
|
|
1344
1345
|
:voice_channel_move event_name,
|
|
1345
1346
|
?id: Symbol?,
|
|
1346
1347
|
**untyped metadata
|
|
1347
1348
|
) {
|
|
1348
|
-
-> void
|
|
1349
|
+
(Discorb::VoiceState before, Discorb::VoiceState after) -> void
|
|
1349
1350
|
} -> void
|
|
1350
1351
|
| (
|
|
1351
1352
|
:voice_channel_update event_name,
|
|
1352
1353
|
?id: Symbol?,
|
|
1353
1354
|
**untyped metadata
|
|
1354
1355
|
) {
|
|
1355
|
-
-> void
|
|
1356
|
+
(Discorb::VoiceState before, Discorb::VoiceState after) -> void
|
|
1356
1357
|
} -> void
|
|
1357
1358
|
| (
|
|
1358
1359
|
:voice_mute_disable event_name,
|
|
@@ -1720,9 +1721,9 @@ module Discorb
|
|
|
1720
1721
|
) -> untyped
|
|
1721
1722
|
|
|
1722
1723
|
# @return [Hash{Symbol => Array<Discorb::EventHandler>}] The events of the extension.
|
|
1723
|
-
attr_reader events: ::Hash[Symbol, [Symbol?, Hash[untyped, untyped], ^(
|
|
1724
|
+
attr_reader events: ::Hash[Symbol, Array[[Symbol?, Hash[untyped, untyped], ^(
|
|
1724
1725
|
*untyped
|
|
1725
|
-
) -> void]]
|
|
1726
|
+
) -> void]]]
|
|
1726
1727
|
|
|
1727
1728
|
# @return [Array<Discorb::ApplicationCommand::Command>] The commands of the extension.
|
|
1728
1729
|
attr_reader commands: ::Array[Discorb::ApplicationCommand::Command]
|
data/sig/discorb/flag.rbs
CHANGED
data/sig/discorb/gateway.rbs
CHANGED
|
@@ -14,6 +14,7 @@ module Discorb
|
|
|
14
14
|
# @param [Hash] data The data of the event.
|
|
15
15
|
def initialize: (Discorb::json data) -> void
|
|
16
16
|
|
|
17
|
+
%a{pure}
|
|
17
18
|
def inspect: -> String
|
|
18
19
|
end
|
|
19
20
|
|
|
@@ -430,14 +431,17 @@ module Discorb
|
|
|
430
431
|
|
|
431
432
|
# @!attribute [r] guild
|
|
432
433
|
# @return [Discorb::Guild] The guild where the rule was executed.
|
|
434
|
+
%a{pure}
|
|
433
435
|
def guild: -> Discorb::Guild
|
|
434
436
|
|
|
435
437
|
# @!attribute [r] channel
|
|
436
438
|
# @return [Discorb::Channel] The channel where the rule was executed.
|
|
439
|
+
%a{pure}
|
|
437
440
|
def channel: -> Discorb::Channel
|
|
438
441
|
|
|
439
442
|
# @!attribute [r] member
|
|
440
443
|
# @return [Discorb::Member] The member that triggered the action.
|
|
444
|
+
%a{pure}
|
|
441
445
|
def member: -> Discorb::Member
|
|
442
446
|
|
|
443
447
|
alias user member
|
|
@@ -463,6 +467,7 @@ module Discorb
|
|
|
463
467
|
# A class for connecting websocket with raw bytes data.
|
|
464
468
|
# @private
|
|
465
469
|
class RawConnection < Async::WebSocket::Connection
|
|
470
|
+
%a{pure}
|
|
466
471
|
def inspect: -> String
|
|
467
472
|
|
|
468
473
|
def closed?: -> bool
|
data/sig/discorb/guild.rbs
CHANGED
|
@@ -22,6 +22,7 @@ module Discorb
|
|
|
22
22
|
bool is_create_event
|
|
23
23
|
) -> void
|
|
24
24
|
|
|
25
|
+
%a{pure}
|
|
25
26
|
def inspect: -> String
|
|
26
27
|
|
|
27
28
|
#
|
|
@@ -29,7 +30,7 @@ module Discorb
|
|
|
29
30
|
# @async
|
|
30
31
|
#
|
|
31
32
|
# @return [Async::Task<void>] The task.
|
|
32
|
-
def leave
|
|
33
|
+
def leave: -> Async::Task[void]
|
|
33
34
|
|
|
34
35
|
#
|
|
35
36
|
# Fetch scheduled events for the guild.
|
|
@@ -308,7 +309,7 @@ module Discorb
|
|
|
308
309
|
#
|
|
309
310
|
# @return [Async::Task<Discorb::Member>] The member.
|
|
310
311
|
# @return [Async::Task<nil>] If the member is not found.
|
|
311
|
-
def fetch_member_named: -> Async::Task[Discorb::Member]
|
|
312
|
+
def fetch_member_named: (String name) -> Async::Task[Discorb::Member]
|
|
312
313
|
|
|
313
314
|
#
|
|
314
315
|
# Change nickname of client member.
|
|
@@ -588,12 +589,12 @@ module Discorb
|
|
|
588
589
|
String name,
|
|
589
590
|
Discorb::AutoModRule::trigger_type trigger_type,
|
|
590
591
|
Array[Discorb::AutoModRule::Action] actions,
|
|
591
|
-
?:
|
|
592
|
+
?:message_send event_type,
|
|
592
593
|
?enabled: bool,
|
|
593
594
|
?exempt_roles: Array[Discorb::Role],
|
|
594
595
|
?exempt_channels: Array[Discorb::Channel],
|
|
595
596
|
?keyword_filter: Array[String]?,
|
|
596
|
-
?presets:
|
|
597
|
+
?presets: Discorb::AutoModRule::preset_type?,
|
|
597
598
|
?reason: nil
|
|
598
599
|
) -> Async::Task[void]
|
|
599
600
|
|
|
@@ -858,6 +859,7 @@ module Discorb
|
|
|
858
859
|
Discorb::json data
|
|
859
860
|
) -> void
|
|
860
861
|
|
|
862
|
+
%a{pure}
|
|
861
863
|
def inspect: -> String
|
|
862
864
|
|
|
863
865
|
# @return [Discorb::User] The user.
|
data/sig/discorb/http.rbs
CHANGED
|
@@ -57,11 +57,12 @@ module Discorb
|
|
|
57
57
|
def multipart_request: (
|
|
58
58
|
Discorb::Route path,
|
|
59
59
|
json | String body,
|
|
60
|
-
::Array[Discorb::Attachment] files,
|
|
60
|
+
::Array[Discorb::Attachment]? files,
|
|
61
61
|
?audit_log_reason: String?,
|
|
62
62
|
**untyped kwargs
|
|
63
63
|
) -> Async::Task[[Net::HTTPResponse, json]]
|
|
64
64
|
|
|
65
|
+
%a{pure}
|
|
65
66
|
def inspect: -> String
|
|
66
67
|
|
|
67
68
|
private
|
|
@@ -100,6 +101,7 @@ module Discorb
|
|
|
100
101
|
class Route
|
|
101
102
|
def initialize: (untyped url, untyped key, untyped method) -> void
|
|
102
103
|
|
|
104
|
+
%a{pure}
|
|
103
105
|
def inspect: -> String
|
|
104
106
|
|
|
105
107
|
def hash: -> untyped
|
|
@@ -129,6 +131,7 @@ module Discorb
|
|
|
129
131
|
# @param [Discorb::Client] client The client.
|
|
130
132
|
def initialize: (Discorb::Client client) -> void
|
|
131
133
|
|
|
134
|
+
%a{pure}
|
|
132
135
|
def inspect: -> String
|
|
133
136
|
|
|
134
137
|
#
|