discorb 0.18.0 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build_version.yml +2 -2
  3. data/.rubocop.yml +12 -75
  4. data/Changelog.md +25 -0
  5. data/Gemfile +4 -4
  6. data/README.md +2 -1
  7. data/Rakefile +482 -459
  8. data/Steepfile +8 -6
  9. data/docs/application_command.md +1 -0
  10. data/docs/events.md +2 -2
  11. data/docs/voice_events.md +6 -6
  12. data/lib/discorb/allowed_mentions.rb +68 -72
  13. data/lib/discorb/app_command/command.rb +466 -394
  14. data/lib/discorb/app_command/common.rb +65 -25
  15. data/lib/discorb/app_command/handler.rb +304 -265
  16. data/lib/discorb/app_command.rb +5 -5
  17. data/lib/discorb/application.rb +198 -197
  18. data/lib/discorb/asset.rb +101 -101
  19. data/lib/discorb/attachment.rb +134 -119
  20. data/lib/discorb/audit_logs.rb +412 -385
  21. data/lib/discorb/automod.rb +279 -269
  22. data/lib/discorb/channel/base.rb +107 -108
  23. data/lib/discorb/channel/category.rb +32 -32
  24. data/lib/discorb/channel/container.rb +44 -44
  25. data/lib/discorb/channel/dm.rb +26 -28
  26. data/lib/discorb/channel/guild.rb +311 -246
  27. data/lib/discorb/channel/stage.rb +156 -140
  28. data/lib/discorb/channel/text.rb +430 -336
  29. data/lib/discorb/channel/thread.rb +374 -325
  30. data/lib/discorb/channel/voice.rb +85 -79
  31. data/lib/discorb/channel.rb +5 -5
  32. data/lib/discorb/client.rb +635 -623
  33. data/lib/discorb/color.rb +178 -182
  34. data/lib/discorb/common.rb +168 -164
  35. data/lib/discorb/components/button.rb +107 -106
  36. data/lib/discorb/components/select_menu.rb +157 -145
  37. data/lib/discorb/components/text_input.rb +103 -106
  38. data/lib/discorb/components.rb +68 -66
  39. data/lib/discorb/dictionary.rb +135 -135
  40. data/lib/discorb/embed.rb +404 -398
  41. data/lib/discorb/emoji.rb +309 -302
  42. data/lib/discorb/emoji_table.rb +16099 -8857
  43. data/lib/discorb/error.rb +131 -131
  44. data/lib/discorb/event.rb +360 -314
  45. data/lib/discorb/event_handler.rb +39 -39
  46. data/lib/discorb/exe/about.rb +17 -17
  47. data/lib/discorb/exe/irb.rb +72 -67
  48. data/lib/discorb/exe/new.rb +323 -315
  49. data/lib/discorb/exe/run.rb +69 -68
  50. data/lib/discorb/exe/setup.rb +57 -55
  51. data/lib/discorb/exe/show.rb +12 -12
  52. data/lib/discorb/extend.rb +25 -45
  53. data/lib/discorb/extension.rb +89 -83
  54. data/lib/discorb/flag.rb +126 -128
  55. data/lib/discorb/gateway.rb +984 -794
  56. data/lib/discorb/gateway_events.rb +670 -638
  57. data/lib/discorb/gateway_requests.rb +45 -48
  58. data/lib/discorb/guild.rb +2115 -1626
  59. data/lib/discorb/guild_template.rb +280 -241
  60. data/lib/discorb/http.rb +247 -232
  61. data/lib/discorb/image.rb +42 -42
  62. data/lib/discorb/integration.rb +169 -161
  63. data/lib/discorb/intents.rb +161 -163
  64. data/lib/discorb/interaction/autocomplete.rb +76 -62
  65. data/lib/discorb/interaction/command.rb +279 -224
  66. data/lib/discorb/interaction/components.rb +114 -104
  67. data/lib/discorb/interaction/modal.rb +36 -32
  68. data/lib/discorb/interaction/response.rb +379 -330
  69. data/lib/discorb/interaction/root.rb +271 -118
  70. data/lib/discorb/interaction.rb +5 -5
  71. data/lib/discorb/invite.rb +154 -153
  72. data/lib/discorb/member.rb +344 -311
  73. data/lib/discorb/message.rb +615 -544
  74. data/lib/discorb/message_meta.rb +197 -186
  75. data/lib/discorb/modules.rb +371 -290
  76. data/lib/discorb/permission.rb +305 -289
  77. data/lib/discorb/presence.rb +352 -346
  78. data/lib/discorb/rate_limit.rb +81 -76
  79. data/lib/discorb/reaction.rb +55 -54
  80. data/lib/discorb/role.rb +272 -240
  81. data/lib/discorb/shard.rb +76 -74
  82. data/lib/discorb/sticker.rb +193 -171
  83. data/lib/discorb/user.rb +205 -188
  84. data/lib/discorb/utils/colored_puts.rb +16 -16
  85. data/lib/discorb/utils.rb +12 -16
  86. data/lib/discorb/voice_state.rb +305 -281
  87. data/lib/discorb/webhook.rb +537 -507
  88. data/lib/discorb.rb +62 -56
  89. data/sig/discorb/activity.rbs +1 -0
  90. data/sig/discorb/allowed_mentions.rbs +1 -0
  91. data/sig/discorb/app_command/base.rbs +7 -1
  92. data/sig/discorb/application.rbs +6 -0
  93. data/sig/discorb/asset.rbs +2 -0
  94. data/sig/discorb/attachment.rbs +8 -0
  95. data/sig/discorb/audit_log.rbs +7 -0
  96. data/sig/discorb/automod.rbs +32 -6
  97. data/sig/discorb/avatar.rbs +1 -0
  98. data/sig/discorb/channel/base.rbs +8 -1
  99. data/sig/discorb/channel/category.rbs +1 -0
  100. data/sig/discorb/channel/container.rbs +4 -0
  101. data/sig/discorb/channel/stage.rbs +4 -0
  102. data/sig/discorb/channel/text.rbs +2 -2
  103. data/sig/discorb/channel/thread.rbs +11 -0
  104. data/sig/discorb/channel/voice.rbs +2 -0
  105. data/sig/discorb/client.rbs +21 -20
  106. data/sig/discorb/color.rbs +6 -0
  107. data/sig/discorb/component/base.rbs +1 -0
  108. data/sig/discorb/component/button.rbs +2 -0
  109. data/sig/discorb/component/select_menu.rbs +4 -0
  110. data/sig/discorb/component/text_input.rbs +1 -0
  111. data/sig/discorb/custom_emoji.rbs +5 -1
  112. data/sig/discorb/dictionary.rbs +2 -0
  113. data/sig/discorb/discord_model.rbs +2 -0
  114. data/sig/discorb/embed.rbs +7 -0
  115. data/sig/discorb/emoji.rbs +1 -0
  116. data/sig/discorb/event_handler.rbs +2 -1
  117. data/sig/discorb/extension.rbs +13 -12
  118. data/sig/discorb/flag.rbs +2 -0
  119. data/sig/discorb/gateway.rbs +5 -0
  120. data/sig/discorb/guild.rbs +8 -4
  121. data/sig/discorb/guild_template.rbs +1 -1
  122. data/sig/discorb/http.rbs +4 -1
  123. data/sig/discorb/image.rbs +2 -0
  124. data/sig/discorb/integration.rbs +1 -1
  125. data/sig/discorb/intents.rbs +4 -3
  126. data/sig/discorb/interaction/base.rbs +36 -0
  127. data/sig/discorb/interaction/message_component.rbs +1 -2
  128. data/sig/discorb/interaction/modal.rbs +1 -2
  129. data/sig/discorb/interaction/responder.rbs +49 -49
  130. data/sig/discorb/invite.rbs +1 -1
  131. data/sig/discorb/member.rbs +2 -0
  132. data/sig/discorb/message.rbs +8 -1
  133. data/sig/discorb/messageable.rbs +1 -4
  134. data/sig/discorb/partial_emoji.rbs +3 -0
  135. data/sig/discorb/permissions.rbs +7 -0
  136. data/sig/discorb/presence.rbs +2 -0
  137. data/sig/discorb/reaction.rbs +5 -1
  138. data/sig/discorb/role.rbs +7 -1
  139. data/sig/discorb/scheduled_event.rbs +2 -1
  140. data/sig/discorb/shard.rbs +2 -1
  141. data/sig/discorb/snowflake.rbs +2 -0
  142. data/sig/discorb/stage_instance.rbs +9 -3
  143. data/sig/discorb/sticker.rbs +1 -1
  144. data/sig/discorb/unicode_emoji.rbs +4 -0
  145. data/sig/discorb/user.rbs +24 -20
  146. data/sig/discorb/webhook.rbs +17 -6
  147. data/sig/discorb/welcome_screen.rbs +1 -0
  148. data/sig/override.rbs +2 -0
  149. metadata +3 -3
@@ -464,7 +464,7 @@ module Discorb
464
464
  (Discorb::MessageComponentInteraction::SelectMenu interaction) -> void
465
465
  } -> Discorb::EventHandler
466
466
  | (
467
- :form_submit event_name,
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
- :form_submit event_name,
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
- :form_submit event,
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[void]
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[void]
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[void]
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[void]
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!: -> void
2325
+ def close: -> void
2325
2326
 
2326
2327
  private
2327
2328
 
@@ -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
  #
@@ -3,6 +3,7 @@ module Discorb
3
3
  # @abstract
4
4
  # Represents a Discord component.
5
5
  class Component
6
+ %a{pure}
6
7
  def inspect: -> String
7
8
 
8
9
  #
@@ -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!: (?reason: String?) -> Async::Task[self]
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.
@@ -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.
@@ -7,9 +7,11 @@ module Discorb
7
7
 
8
8
  def ==: (untyped other) -> untyped
9
9
 
10
+ %a{pure}
10
11
  def inspect: -> String
11
12
 
12
13
  # @private
14
+ %a{pure}
13
15
  def hash: -> untyped
14
16
  end
15
17
  end
@@ -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.
@@ -8,6 +8,7 @@ module Discorb
8
8
 
9
9
  def ==: (untyped other) -> untyped
10
10
 
11
+ %a{pure}
11
12
  def inspect: -> String
12
13
  end
13
14
  end
@@ -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
@@ -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
- :form_submit event_name,
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
- :form_submit event_name,
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
@@ -47,8 +47,10 @@ module Discorb
47
47
  # @return [Discorb::Flag] The negation of the flag.
48
48
  def ~: -> instance
49
49
 
50
+ %a{pure}
50
51
  def to_i: -> Integer
51
52
 
53
+ %a{pure}
52
54
  def inspect: -> String
53
55
 
54
56
  #
@@ -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
@@ -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!: -> Async::Task[void]
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,14 @@ module Discorb
588
589
  String name,
589
590
  Discorb::AutoModRule::trigger_type trigger_type,
590
591
  Array[Discorb::AutoModRule::Action] actions,
591
- ?:send_message event_type,
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: :profanity | :sexual_content | :slurs,
597
+ ?presets: Discorb::AutoModRule::preset_type?,
598
+ ?mention_total_limit: Integer?,
599
+ ?allow_list: Array[String]?,
597
600
  ?reason: nil
598
601
  ) -> Async::Task[void]
599
602
 
@@ -858,6 +861,7 @@ module Discorb
858
861
  Discorb::json data
859
862
  ) -> void
860
863
 
864
+ %a{pure}
861
865
  def inspect: -> String
862
866
 
863
867
  # @return [Discorb::User] The user.
@@ -33,7 +33,7 @@ module Discorb
33
33
  # @async
34
34
  #
35
35
  # @return [Async::Task<void>] The task.
36
- def delete!: -> Async::Task[void]
36
+ def delete: -> Async::Task[void]
37
37
 
38
38
  # @return [String] The code of the template.
39
39
  attr_reader code: String
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
  #
@@ -13,8 +13,10 @@ module Discorb
13
13
  # Formats the image as a Discord style.
14
14
  #
15
15
  # @return [String] The image as a Discord style.
16
+ %a{pure}
16
17
  def to_s: -> String
17
18
 
19
+ %a{pure}
18
20
  def inspect: -> String
19
21
  end
20
22
  end
@@ -24,7 +24,7 @@ module Discorb
24
24
  # @param [String] reason The reason for deleting the integration.
25
25
  #
26
26
  # @return [Async::Task<void>] The task.
27
- def delete!: (?reason: String?) -> Async::Task[void]
27
+ def delete: (?reason: String?) -> Async::Task[void]
28
28
 
29
29
  # @return [Discorb::Snowflake] The ID of the integration.
30
30
  attr_reader id: Discorb::Snowflake
@@ -30,8 +30,6 @@ module Discorb
30
30
  # this will be required in September 1, 2022. [Learn More](https://support-dev.discord.com/hc/en-us/articles/4404772028055).
31
31
  # You should specify `message_content` intent for preventing unexpected changes in the future.
32
32
  def initialize: (
33
- automod_configuration: bool,
34
- automod_execution: bool,
35
33
  ?guilds: bool,
36
34
  ?members: bool,
37
35
  ?bans: bool,
@@ -48,7 +46,9 @@ module Discorb
48
46
  ?dm_reactions: bool,
49
47
  ?dm_typing: bool,
50
48
  ?message_content: bool?,
51
- ?scheduled_events: bool
49
+ ?scheduled_events: bool,
50
+ ?automod_configuration: bool,
51
+ ?automod_execution: bool
52
52
  ) -> void
53
53
 
54
54
  #
@@ -61,6 +61,7 @@ module Discorb
61
61
  # @return [Integer] The value of the intent.
62
62
  def value: -> Integer
63
63
 
64
+ %a{pure}
64
65
  def inspect: -> String
65
66
 
66
67
  def to_h: -> Hash[Symbol, bool]