discorb 0.16.0 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +1 -0
  3. data/.github/workflows/build_main.yml +2 -2
  4. data/.github/workflows/build_version.yml +1 -1
  5. data/.github/workflows/codeql-analysis.yml +1 -1
  6. data/.github/workflows/lint-push.yml +3 -5
  7. data/.github/workflows/lint.yml +2 -4
  8. data/.github/workflows/spec.yml +33 -0
  9. data/.github/workflows/validate.yml +21 -0
  10. data/.gitignore +2 -0
  11. data/.lefthook/commit-msg/validator.rb +5 -0
  12. data/.rspec +2 -0
  13. data/.rspec_parallel +2 -0
  14. data/.rubocop.yml +43 -6
  15. data/Changelog.md +30 -1
  16. data/Gemfile +20 -8
  17. data/Rakefile +226 -98
  18. data/Steepfile +28 -0
  19. data/bin/console +3 -3
  20. data/docs/Examples.md +1 -1
  21. data/docs/application_command.md +156 -47
  22. data/docs/cli/irb.md +2 -2
  23. data/docs/cli/new.md +14 -9
  24. data/docs/cli/run.md +7 -11
  25. data/docs/cli.md +17 -10
  26. data/docs/events.md +247 -213
  27. data/docs/extension.md +1 -2
  28. data/docs/faq.md +0 -1
  29. data/docs/tutorial.md +18 -18
  30. data/docs/voice_events.md +106 -106
  31. data/examples/commands/message.rb +68 -0
  32. data/examples/commands/permission.rb +19 -0
  33. data/examples/commands/slash.rb +48 -0
  34. data/examples/commands/user.rb +54 -0
  35. data/examples/components/authorization_button.rb +4 -3
  36. data/examples/components/select_menu.rb +6 -3
  37. data/examples/extension/main.rb +2 -1
  38. data/examples/extension/message_expander.rb +6 -2
  39. data/examples/sig/commands/message.rbs +5 -0
  40. data/examples/simple/eval.rb +3 -2
  41. data/examples/simple/ping_pong.rb +2 -1
  42. data/examples/simple/rolepanel.rb +17 -6
  43. data/examples/simple/shard.rb +3 -2
  44. data/examples/simple/wait_for_message.rb +4 -1
  45. data/exe/discorb +33 -18
  46. data/lefthook.yml +45 -0
  47. data/lib/discorb/allowed_mentions.rb +2 -1
  48. data/lib/discorb/app_command/command.rb +130 -72
  49. data/lib/discorb/app_command/common.rb +25 -0
  50. data/lib/discorb/app_command/handler.rb +130 -33
  51. data/lib/discorb/app_command.rb +2 -1
  52. data/lib/discorb/application.rb +1 -0
  53. data/lib/discorb/asset.rb +1 -2
  54. data/lib/discorb/attachment.rb +1 -1
  55. data/lib/discorb/audit_logs.rb +19 -10
  56. data/lib/discorb/automod.rb +269 -0
  57. data/lib/discorb/channel/base.rb +108 -0
  58. data/lib/discorb/channel/category.rb +32 -0
  59. data/lib/discorb/channel/container.rb +44 -0
  60. data/lib/discorb/channel/dm.rb +28 -0
  61. data/lib/discorb/channel/guild.rb +246 -0
  62. data/lib/discorb/channel/stage.rb +140 -0
  63. data/lib/discorb/channel/text.rb +336 -0
  64. data/lib/discorb/channel/thread.rb +325 -0
  65. data/lib/discorb/channel/voice.rb +79 -0
  66. data/lib/discorb/channel.rb +2 -1165
  67. data/lib/discorb/client.rb +50 -36
  68. data/lib/discorb/color.rb +37 -60
  69. data/lib/discorb/common.rb +2 -1
  70. data/lib/discorb/components/button.rb +2 -1
  71. data/lib/discorb/components/select_menu.rb +4 -2
  72. data/lib/discorb/components/text_input.rb +12 -2
  73. data/lib/discorb/components.rb +1 -1
  74. data/lib/discorb/dictionary.rb +1 -1
  75. data/lib/discorb/embed.rb +26 -10
  76. data/lib/discorb/emoji.rb +31 -4
  77. data/lib/discorb/emoji_table.rb +4969 -3
  78. data/lib/discorb/event.rb +29 -4
  79. data/lib/discorb/exe/about.rb +2 -1
  80. data/lib/discorb/exe/irb.rb +2 -4
  81. data/lib/discorb/exe/new.rb +89 -26
  82. data/lib/discorb/exe/run.rb +8 -22
  83. data/lib/discorb/exe/setup.rb +25 -12
  84. data/lib/discorb/exe/show.rb +4 -3
  85. data/lib/discorb/extend.rb +1 -0
  86. data/lib/discorb/extension.rb +6 -7
  87. data/lib/discorb/flag.rb +13 -2
  88. data/lib/discorb/gateway.rb +79 -589
  89. data/lib/discorb/gateway_events.rb +638 -0
  90. data/lib/discorb/guild.rb +318 -67
  91. data/lib/discorb/guild_template.rb +11 -5
  92. data/lib/discorb/http.rb +53 -24
  93. data/lib/discorb/integration.rb +4 -1
  94. data/lib/discorb/intents.rb +28 -19
  95. data/lib/discorb/interaction/autocomplete.rb +28 -16
  96. data/lib/discorb/interaction/command.rb +42 -14
  97. data/lib/discorb/interaction/components.rb +5 -2
  98. data/lib/discorb/interaction/modal.rb +0 -1
  99. data/lib/discorb/interaction/response.rb +125 -26
  100. data/lib/discorb/interaction/root.rb +13 -13
  101. data/lib/discorb/interaction.rb +1 -0
  102. data/lib/discorb/invite.rb +5 -2
  103. data/lib/discorb/member.rb +28 -8
  104. data/lib/discorb/message.rb +60 -25
  105. data/lib/discorb/message_meta.rb +3 -3
  106. data/lib/discorb/modules.rb +59 -16
  107. data/lib/discorb/presence.rb +2 -0
  108. data/lib/discorb/rate_limit.rb +7 -2
  109. data/lib/discorb/reaction.rb +2 -2
  110. data/lib/discorb/role.rb +20 -5
  111. data/lib/discorb/shard.rb +1 -1
  112. data/lib/discorb/sticker.rb +9 -8
  113. data/lib/discorb/user.rb +4 -3
  114. data/lib/discorb/utils/colored_puts.rb +1 -0
  115. data/lib/discorb/voice_state.rb +6 -2
  116. data/lib/discorb/webhook.rb +64 -31
  117. data/lib/discorb.rb +7 -5
  118. data/po/yard.pot +20 -20
  119. data/rbs_collection.lock.yaml +88 -0
  120. data/rbs_collection.yaml +21 -0
  121. data/sig/async.rbs +11 -0
  122. data/sig/discorb/activity.rbs +23 -0
  123. data/sig/discorb/allowed_mentions.rbs +44 -0
  124. data/sig/discorb/app_command/base.rbs +282 -0
  125. data/sig/discorb/app_command/handler.rbs +171 -0
  126. data/sig/discorb/application.rbs +142 -0
  127. data/sig/discorb/asset.rbs +32 -0
  128. data/sig/discorb/attachment.rbs +91 -0
  129. data/sig/discorb/audit_log.rbs +231 -0
  130. data/sig/discorb/automod.rbs +128 -0
  131. data/sig/discorb/avatar.rbs +26 -0
  132. data/sig/discorb/channel/base.rbs +179 -0
  133. data/sig/discorb/channel/category.rbs +56 -0
  134. data/sig/discorb/channel/container.rbs +29 -0
  135. data/sig/discorb/channel/dm.rbs +14 -0
  136. data/sig/discorb/channel/news.rbs +20 -0
  137. data/sig/discorb/channel/stage.rbs +77 -0
  138. data/sig/discorb/channel/text.rbs +158 -0
  139. data/sig/discorb/channel/thread.rbs +185 -0
  140. data/sig/discorb/channel/voice.rbs +41 -0
  141. data/sig/discorb/client.rbs +2495 -0
  142. data/sig/discorb/color.rbs +142 -0
  143. data/sig/discorb/component/base.rbs +28 -0
  144. data/sig/discorb/component/button.rbs +65 -0
  145. data/sig/discorb/component/select_menu.rbs +107 -0
  146. data/sig/discorb/component/text_input.rbs +69 -0
  147. data/sig/discorb/connectable.rbs +8 -0
  148. data/sig/discorb/custom_emoji.rbs +90 -0
  149. data/sig/discorb/dictionary.rbs +85 -0
  150. data/sig/discorb/discord_model.rbs +15 -0
  151. data/sig/discorb/embed.rbs +279 -0
  152. data/sig/discorb/emoji.rbs +13 -0
  153. data/sig/discorb/error.rbs +73 -0
  154. data/sig/discorb/event_handler.rbs +27 -0
  155. data/sig/discorb/extension.rbs +1734 -0
  156. data/sig/discorb/flag.rbs +72 -0
  157. data/sig/discorb/gateway.rbs +481 -0
  158. data/sig/discorb/guild.rbs +870 -0
  159. data/sig/discorb/guild_template.rbs +174 -0
  160. data/sig/discorb/http.rbs +147 -0
  161. data/sig/discorb/image.rbs +20 -0
  162. data/sig/discorb/integration.rbs +118 -0
  163. data/sig/discorb/intents.rbs +97 -0
  164. data/sig/discorb/interaction/autocomplete.rbs +9 -0
  165. data/sig/discorb/interaction/base.rbs +66 -0
  166. data/sig/discorb/interaction/command.rbs +66 -0
  167. data/sig/discorb/interaction/message_component.rbs +140 -0
  168. data/sig/discorb/interaction/modal.rbs +50 -0
  169. data/sig/discorb/interaction/responder.rbs +157 -0
  170. data/sig/discorb/invite.rbs +86 -0
  171. data/sig/discorb/member.rbs +187 -0
  172. data/sig/discorb/message.rbs +469 -0
  173. data/sig/discorb/messageable.rbs +153 -0
  174. data/sig/discorb/partial_emoji.rbs +35 -0
  175. data/sig/discorb/permissions.rbs +149 -0
  176. data/sig/discorb/presence.rbs +237 -0
  177. data/sig/discorb/reaction.rbs +33 -0
  178. data/sig/discorb/role.rbs +145 -0
  179. data/sig/discorb/scheduled_event.rbs +148 -0
  180. data/sig/discorb/shard.rbs +62 -0
  181. data/sig/discorb/snowflake.rbs +56 -0
  182. data/sig/discorb/stage_instance.rbs +63 -0
  183. data/sig/discorb/sticker.rbs +116 -0
  184. data/sig/discorb/system_channel_flag.rbs +17 -0
  185. data/sig/discorb/unicode_emoji.rbs +49 -0
  186. data/sig/discorb/user.rbs +93 -0
  187. data/sig/discorb/utils.rbs +8 -0
  188. data/sig/discorb/voice_region.rbs +30 -0
  189. data/sig/discorb/voice_state.rbs +71 -0
  190. data/sig/discorb/webhook.rbs +327 -0
  191. data/sig/discorb/welcome_screen.rbs +78 -0
  192. data/sig/discorb.rbs +6 -7230
  193. data/sig/manifest.yaml +3 -0
  194. data/sig/override.rbs +19 -0
  195. data/template-replace/files/css/common.css +4 -0
  196. metadata +102 -6
  197. data/examples/commands/bookmarker.rb +0 -42
  198. data/examples/commands/hello.rb +0 -10
  199. data/examples/commands/inspect.rb +0 -25
@@ -0,0 +1,2495 @@
1
+ module Discorb
2
+ #
3
+ # Class for connecting to the Discord server.
4
+ class Client
5
+ include Discorb::Gateway::Handler
6
+ include Discorb::ApplicationCommand::Handler
7
+
8
+ #
9
+ # Initializes a new client.
10
+ #
11
+ # @param [Discorb::AllowedMentions] allowed_mentions The allowed mentions that the client is using.
12
+ # @param [Discorb::Intents] intents The intents that the client is currently using.
13
+ # @param [Integer] message_caches The number of messages to cache.
14
+ # @param [Logger] logger The IO object to use for logging.
15
+ # @param [:debug, :info, :warn, :error, :critical] log_level The log level.
16
+ # @param [Boolean] wait_until_ready Whether to delay event dispatch until ready.
17
+ # @param [Boolean] fetch_member Whether to fetch member on ready. This may slow down the client. Default to `false`.
18
+ # @param [String] title
19
+ # The title of the process. `false` to default of ruby, `nil` to `discorb: User#0000`. Default to `nil`.
20
+ def initialize: (
21
+ ?allowed_mentions: Discorb::AllowedMentions?,
22
+ ?intents: Discorb::Intents?,
23
+ ?message_caches: Integer,
24
+ ?logger: Logger?,
25
+ ?wait_until_ready: bool,
26
+ ?fetch_member: bool,
27
+ ?title: String?
28
+ ) -> void
29
+
30
+ #
31
+ # Registers an event handler.
32
+ # @see file:docs/Events.md Events Documentation
33
+ #
34
+ # @param [Symbol] event_name The name of the event.
35
+ # @param [Symbol] id Custom ID of the event.
36
+ # @param [Hash] metadata The metadata of the event.
37
+ # @param [Proc] block The block to execute when the event is triggered.
38
+ #
39
+ # @return [Discorb::EventHandler] The event.
40
+ def on:
41
+ (
42
+ :event_receive event_name,
43
+ ?id: Symbol?,
44
+ **untyped metadata
45
+ ) {
46
+ (Symbol event_name, Discorb::json data) -> void
47
+ } -> Discorb::EventHandler
48
+ | (
49
+ :ready event_name,
50
+ ?id: Symbol?,
51
+ **untyped metadata
52
+ ) {
53
+ -> void
54
+ } -> Discorb::EventHandler
55
+ | (
56
+ :standby event_name,
57
+ ?id: Symbol?,
58
+ **untyped metadata
59
+ ) {
60
+ -> void
61
+ } -> Discorb::EventHandler
62
+ | (
63
+ :resumed event_name,
64
+ ?id: Symbol?,
65
+ **untyped metadata
66
+ ) {
67
+ -> void
68
+ } -> Discorb::EventHandler
69
+ | (
70
+ :error event_name,
71
+ ?id: Symbol?,
72
+ **untyped metadata
73
+ ) {
74
+ (Symbol event_name, Array[Object] args, Exception error) -> void
75
+ } -> Discorb::EventHandler
76
+ | (
77
+ :setup event_name,
78
+ ?id: Symbol?,
79
+ **untyped metadata
80
+ ) {
81
+ -> void
82
+ } -> Discorb::EventHandler
83
+ | (
84
+ :shard_standby event_name,
85
+ ?id: Symbol?,
86
+ **untyped metadata
87
+ ) {
88
+ (Discorb::Shard shard) -> void
89
+ } -> Discorb::EventHandler
90
+ | (
91
+ :shard_resumed event_name,
92
+ ?id: Symbol?,
93
+ **untyped metadata
94
+ ) {
95
+ (Discorb::Shard shard) -> void
96
+ } -> Discorb::EventHandler
97
+ | (
98
+ :guild_join event_name,
99
+ ?id: Symbol?,
100
+ **untyped metadata
101
+ ) {
102
+ (Discorb::Guild guild) -> void
103
+ } -> Discorb::EventHandler
104
+ | (
105
+ :guild_available event_name,
106
+ ?id: Symbol?,
107
+ **untyped metadata
108
+ ) {
109
+ (Discorb::Guild guild) -> void
110
+ } -> Discorb::EventHandler
111
+ | (
112
+ :guild_update event_name,
113
+ ?id: Symbol?,
114
+ **untyped metadata
115
+ ) {
116
+ (Discorb::Guild before, Discorb::Guild after) -> void
117
+ } -> Discorb::EventHandler
118
+ | (
119
+ :guild_leave event_name,
120
+ ?id: Symbol?,
121
+ **untyped metadata
122
+ ) {
123
+ (Discorb::Guild guild) -> void
124
+ } -> Discorb::EventHandler
125
+ | (
126
+ :guild_destroy event_name,
127
+ ?id: Symbol?,
128
+ **untyped metadata
129
+ ) {
130
+ (Discorb::Guild guild) -> void
131
+ } -> Discorb::EventHandler
132
+ | (
133
+ :guild_integrations_update event_name,
134
+ ?id: Symbol?,
135
+ **untyped metadata
136
+ ) {
137
+ (Discorb::Guild guild) -> void
138
+ } -> Discorb::EventHandler
139
+ | (
140
+ :guild_ban_add event_name,
141
+ ?id: Symbol?,
142
+ **untyped metadata
143
+ ) {
144
+ (Discorb::Guild guild, Discorb::User user) -> void
145
+ } -> Discorb::EventHandler
146
+ | (
147
+ :guild_ban_remove event_name,
148
+ ?id: Symbol?,
149
+ **untyped metadata
150
+ ) {
151
+ (Discorb::Guild guild, Discorb::User user) -> void
152
+ } -> Discorb::EventHandler
153
+ | (
154
+ :channel_create event_name,
155
+ ?id: Symbol?,
156
+ **untyped metadata
157
+ ) {
158
+ (Discorb::Channel channel) -> void
159
+ } -> Discorb::EventHandler
160
+ | (
161
+ :channel_update event_name,
162
+ ?id: Symbol?,
163
+ **untyped metadata
164
+ ) {
165
+ (Discorb::Channel before, Discorb::Channel after) -> void
166
+ } -> Discorb::EventHandler
167
+ | (
168
+ :channel_delete event_name,
169
+ ?id: Symbol?,
170
+ **untyped metadata
171
+ ) {
172
+ (Discorb::Channel channel) -> void
173
+ } -> Discorb::EventHandler
174
+ | (
175
+ :webhooks_update event_name,
176
+ ?id: Symbol?,
177
+ **untyped metadata
178
+ ) {
179
+ (Discorb::Gateway::WebhooksUpdateEvent event) -> void
180
+ } -> Discorb::EventHandler
181
+ | (
182
+ :thread_new event_name,
183
+ ?id: Symbol?,
184
+ **untyped metadata
185
+ ) {
186
+ (Discorb::ThreadChannel thread) -> void
187
+ } -> Discorb::EventHandler
188
+ | (
189
+ :thread_join event_name,
190
+ ?id: Symbol?,
191
+ **untyped metadata
192
+ ) {
193
+ (Discorb::ThreadChannel thread) -> void
194
+ } -> Discorb::EventHandler
195
+ | (
196
+ :thread_delete event_name,
197
+ ?id: Symbol?,
198
+ **untyped metadata
199
+ ) {
200
+ (Discorb::ThreadChannel thread) -> void
201
+ } -> Discorb::EventHandler
202
+ | (
203
+ :thread_update event_name,
204
+ ?id: Symbol?,
205
+ **untyped metadata
206
+ ) {
207
+ (Discorb::ThreadChannel before, Discorb::ThreadChannel after) -> void
208
+ } -> Discorb::EventHandler
209
+ | (
210
+ :thread_members_update event_name,
211
+ ?id: Symbol?,
212
+ **untyped metadata
213
+ ) {
214
+ (
215
+ Discorb::ThreadChannel thread,
216
+ Array[Discorb::ThreadChannel::Member] added,
217
+ Array[Discorb::ThreadChannel::Member] removed
218
+ ) -> void
219
+ } -> Discorb::EventHandler
220
+ | (
221
+ :thread_member_update event_name,
222
+ ?id: Symbol?,
223
+ **untyped metadata
224
+ ) {
225
+ (
226
+ Discorb::ThreadChannel thread,
227
+ Discorb::ThreadChannel::Member before,
228
+ Discorb::ThreadChannel::Member after
229
+ ) -> void
230
+ } -> Discorb::EventHandler
231
+ | (
232
+ :integration_create event_name,
233
+ ?id: Symbol?,
234
+ **untyped metadata
235
+ ) {
236
+ (Discorb::Integration integration) -> void
237
+ } -> Discorb::EventHandler
238
+ | (
239
+ :integration_update event_name,
240
+ ?id: Symbol?,
241
+ **untyped metadata
242
+ ) {
243
+ (Discorb::Integration after) -> void
244
+ } -> Discorb::EventHandler
245
+ | (
246
+ :integration_delete event_name,
247
+ ?id: Symbol?,
248
+ **untyped metadata
249
+ ) {
250
+ (Discorb::Integration integration) -> void
251
+ } -> Discorb::EventHandler
252
+ | (
253
+ :message event_name,
254
+ ?id: Symbol?,
255
+ **untyped metadata
256
+ ) {
257
+ (Discorb::Message message) -> void
258
+ } -> Discorb::EventHandler
259
+ | (
260
+ :message_update event_name,
261
+ ?id: Symbol?,
262
+ **untyped metadata
263
+ ) {
264
+ (Discorb::Gateway::MessageUpdateEvent event) -> void
265
+ } -> Discorb::EventHandler
266
+ | (
267
+ :message_delete event_name,
268
+ ?id: Symbol?,
269
+ **untyped metadata
270
+ ) {
271
+ (
272
+ Discorb::Message message,
273
+ Discorb::Channel channel,
274
+ Discorb::Guild guild
275
+ ) -> void
276
+ } -> Discorb::EventHandler
277
+ | (
278
+ :message_delete_id event_name,
279
+ ?id: Symbol?,
280
+ **untyped metadata
281
+ ) {
282
+ (
283
+ Discorb::Snowflake message_id,
284
+ Discorb::Channel channel,
285
+ Discorb::Guild guild
286
+ ) -> void
287
+ } -> Discorb::EventHandler
288
+ | (
289
+ :message_delete_bulk event_name,
290
+ ?id: Symbol?,
291
+ **untyped metadata
292
+ ) {
293
+ (
294
+ Array[Discorb::Message
295
+ | Discorb::Gateway::UnknownDeleteBulkMessage] messages
296
+ ) -> void
297
+ } -> Discorb::EventHandler
298
+ | (
299
+ :message_pin_update event_name,
300
+ ?id: Symbol?,
301
+ **untyped metadata
302
+ ) {
303
+ (Discorb::Gateway::MessagePinEvent event) -> void
304
+ } -> Discorb::EventHandler
305
+ | (
306
+ :typing_start event_name,
307
+ ?id: Symbol?,
308
+ **untyped metadata
309
+ ) {
310
+ (Discorb::Gateway::TypingStartEvent event) -> void
311
+ } -> Discorb::EventHandler
312
+ | (
313
+ :reaction_add event_name,
314
+ ?id: Symbol?,
315
+ **untyped metadata
316
+ ) {
317
+ (Discorb::Gateway::ReactionEvent event) -> void
318
+ } -> Discorb::EventHandler
319
+ | (
320
+ :reaction_remove event_name,
321
+ ?id: Symbol?,
322
+ **untyped metadata
323
+ ) {
324
+ (Discorb::Gateway::ReactionEvent event) -> void
325
+ } -> Discorb::EventHandler
326
+ | (
327
+ :reaction_remove_all event_name,
328
+ ?id: Symbol?,
329
+ **untyped metadata
330
+ ) {
331
+ (Discorb::Gateway::ReactionRemoveAllEvent event) -> void
332
+ } -> Discorb::EventHandler
333
+ | (
334
+ :reaction_remove_emoji event_name,
335
+ ?id: Symbol?,
336
+ **untyped metadata
337
+ ) {
338
+ (Discorb::Gateway::ReactionRemoveEmojiEvent event) -> void
339
+ } -> Discorb::EventHandler
340
+ | (
341
+ :role_create event_name,
342
+ ?id: Symbol?,
343
+ **untyped metadata
344
+ ) {
345
+ (Discorb::Role role) -> void
346
+ } -> Discorb::EventHandler
347
+ | (
348
+ :role_update event_name,
349
+ ?id: Symbol?,
350
+ **untyped metadata
351
+ ) {
352
+ (Discorb::Role before, Discorb::Role after) -> void
353
+ } -> Discorb::EventHandler
354
+ | (
355
+ :role_remove event_name,
356
+ ?id: Symbol?,
357
+ **untyped metadata
358
+ ) {
359
+ (Discorb::Role role) -> void
360
+ } -> Discorb::EventHandler
361
+ | (
362
+ :member_add event_name,
363
+ ?id: Symbol?,
364
+ **untyped metadata
365
+ ) {
366
+ (Discorb::Member member) -> void
367
+ } -> Discorb::EventHandler
368
+ | (
369
+ :member_update event_name,
370
+ ?id: Symbol?,
371
+ **untyped metadata
372
+ ) {
373
+ (Discorb::Member before, Discorb::Member after) -> void
374
+ } -> Discorb::EventHandler
375
+ | (
376
+ :member_remove event_name,
377
+ ?id: Symbol?,
378
+ **untyped metadata
379
+ ) {
380
+ (Discorb::Member member) -> void
381
+ } -> Discorb::EventHandler
382
+ | (
383
+ :role_create event_name,
384
+ ?id: Symbol?,
385
+ **untyped metadata
386
+ ) {
387
+ (Discorb::Role role) -> void
388
+ } -> Discorb::EventHandler
389
+ | (
390
+ :role_update event_name,
391
+ ?id: Symbol?,
392
+ **untyped metadata
393
+ ) {
394
+ (Discorb::Role before, Discorb::Role after) -> void
395
+ } -> Discorb::EventHandler
396
+ | (
397
+ :role_remove event_name,
398
+ ?id: Symbol?,
399
+ **untyped metadata
400
+ ) {
401
+ (Discorb::Role role) -> void
402
+ } -> Discorb::EventHandler
403
+ | (
404
+ :invite_create event_name,
405
+ ?id: Symbol?,
406
+ **untyped metadata
407
+ ) {
408
+ (Discorb::Invite invite) -> void
409
+ } -> Discorb::EventHandler
410
+ | (
411
+ :invite_delete event_name,
412
+ ?id: Symbol?,
413
+ **untyped metadata
414
+ ) {
415
+ (Discorb::Invite invite) -> void
416
+ } -> Discorb::EventHandler
417
+ | (
418
+ :interaction_create event_name,
419
+ ?id: Symbol?,
420
+ **untyped metadata
421
+ ) {
422
+ (Discorb::Interaction interaction) -> void
423
+ } -> Discorb::EventHandler
424
+ | (
425
+ :application_command event_name,
426
+ ?id: Symbol?,
427
+ **untyped metadata
428
+ ) {
429
+ (Discorb::CommandInteraction interaction) -> void
430
+ } -> Discorb::EventHandler
431
+ | (
432
+ :slash_command event_name,
433
+ ?id: Symbol?,
434
+ **untyped metadata
435
+ ) {
436
+ (Discorb::CommandInteraction::ChatInputCommand interaction) -> void
437
+ } -> Discorb::EventHandler
438
+ | (
439
+ :message_command event_name,
440
+ ?id: Symbol?,
441
+ **untyped metadata
442
+ ) {
443
+ (Discorb::CommandInteraction::MessageMenuCommand interaction) -> void
444
+ } -> Discorb::EventHandler
445
+ | (
446
+ :user_command event_name,
447
+ ?id: Symbol?,
448
+ **untyped metadata
449
+ ) {
450
+ (Discorb::CommandInteraction::UserMenuCommand interaction) -> void
451
+ } -> Discorb::EventHandler
452
+ | (
453
+ :button_click event_name,
454
+ ?id: Symbol?,
455
+ **untyped metadata
456
+ ) {
457
+ (Discorb::MessageComponentInteraction::Button interaction) -> void
458
+ } -> Discorb::EventHandler
459
+ | (
460
+ :select_menu_select event_name,
461
+ ?id: Symbol?,
462
+ **untyped metadata
463
+ ) {
464
+ (Discorb::MessageComponentInteraction::SelectMenu interaction) -> void
465
+ } -> Discorb::EventHandler
466
+ | (
467
+ :form_submit event_name,
468
+ ?id: Symbol?,
469
+ **untyped metadata
470
+ ) {
471
+ (Discorb::ModalInteraction interaction) -> void
472
+ } -> Discorb::EventHandler
473
+ | (
474
+ :scheduled_event_create event_name,
475
+ ?id: Symbol?,
476
+ **untyped metadata
477
+ ) {
478
+ (Discorb::ScheduledEvent event) -> void
479
+ } -> Discorb::EventHandler
480
+ | (
481
+ :scheduled_event_cancel event_name,
482
+ ?id: Symbol?,
483
+ **untyped metadata
484
+ ) {
485
+ (Discorb::ScheduledEvent event) -> void
486
+ } -> Discorb::EventHandler
487
+ | (
488
+ :scheduled_event_edit event_name,
489
+ ?id: Symbol?,
490
+ **untyped metadata
491
+ ) {
492
+ (Discorb::ScheduledEvent before, Discorb::ScheduledEvent after) -> void
493
+ } -> Discorb::EventHandler
494
+ | (
495
+ :scheduled_event_start event_name,
496
+ ?id: Symbol?,
497
+ **untyped metadata
498
+ ) {
499
+ (Discorb::ScheduledEvent event) -> void
500
+ } -> Discorb::EventHandler
501
+ | (
502
+ :scheduled_event_end event_name,
503
+ ?id: Symbol?,
504
+ **untyped metadata
505
+ ) {
506
+ (Discorb::ScheduledEvent event) -> void
507
+ } -> Discorb::EventHandler
508
+ | (
509
+ :auto_moderation_rule_create event_name,
510
+ ?id: Symbol?,
511
+ **untyped metadata
512
+ ) {
513
+ (Discorb::AutoModRule rule) -> void
514
+ } -> Discorb::EventHandler
515
+ | (
516
+ :auto_moderation_rule_update event_name,
517
+ ?id: Symbol?,
518
+ **untyped metadata
519
+ ) {
520
+ (Discorb::AutoModRule rule) -> void
521
+ } -> Discorb::EventHandler
522
+ | (
523
+ :auto_moderation_rule_delete event_name,
524
+ ?id: Symbol?,
525
+ **untyped metadata
526
+ ) {
527
+ (Discorb::AutoModRule rule) -> void
528
+ } -> Discorb::EventHandler
529
+ | (
530
+ :auto_moderation_action_execution event_name,
531
+ ?id: Symbol?,
532
+ **untyped metadata
533
+ ) {
534
+ (Discorb::Gateway::AutoModerationActionExecutionEvent event) -> void
535
+ } -> Discorb::EventHandler
536
+ | (
537
+ :guild_create event_name,
538
+ ?id: Symbol?,
539
+ **untyped metadata
540
+ ) {
541
+ (Discorb::Guild guild) -> void
542
+ } -> Discorb::EventHandler
543
+ | (
544
+ :guild_delete event_name,
545
+ ?id: Symbol?,
546
+ **untyped metadata
547
+ ) {
548
+ (Discorb::Guild guild) -> void
549
+ } -> Discorb::EventHandler
550
+ | (
551
+ :thread_create event_name,
552
+ ?id: Symbol?,
553
+ **untyped metadata
554
+ ) {
555
+ (Discorb::ThreadChannel thread) -> void
556
+ } -> Discorb::EventHandler
557
+ | (
558
+ :scheduled_event_update event_name,
559
+ ?id: Symbol?,
560
+ **untyped metadata
561
+ ) {
562
+ (Discorb::ScheduledEvent before, Discorb::ScheduledEvent after) -> void
563
+ } -> Discorb::EventHandler
564
+ | (
565
+ :voice_channel_connect event_name,
566
+ ?id: Symbol?,
567
+ **untyped metadata
568
+ ) {
569
+ -> void
570
+ } -> Discorb::EventHandler
571
+ | (
572
+ :voice_channel_disconnect event_name,
573
+ ?id: Symbol?,
574
+ **untyped metadata
575
+ ) {
576
+ -> void
577
+ } -> Discorb::EventHandler
578
+ | (
579
+ :voice_channel_move event_name,
580
+ ?id: Symbol?,
581
+ **untyped metadata
582
+ ) {
583
+ -> void
584
+ } -> Discorb::EventHandler
585
+ | (
586
+ :voice_channel_update event_name,
587
+ ?id: Symbol?,
588
+ **untyped metadata
589
+ ) {
590
+ -> void
591
+ } -> Discorb::EventHandler
592
+ | (
593
+ :voice_mute_disable event_name,
594
+ ?id: Symbol?,
595
+ **untyped metadata
596
+ ) {
597
+ (Discorb::VoiceState state) -> void
598
+ } -> Discorb::EventHandler
599
+ | (
600
+ :voice_mute_enable event_name,
601
+ ?id: Symbol?,
602
+ **untyped metadata
603
+ ) {
604
+ (Discorb::VoiceState state) -> void
605
+ } -> Discorb::EventHandler
606
+ | (
607
+ :voice_mute_update event_name,
608
+ ?id: Symbol?,
609
+ **untyped metadata
610
+ ) {
611
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> void
612
+ } -> Discorb::EventHandler
613
+ | (
614
+ :voice_server_mute_enable event_name,
615
+ ?id: Symbol?,
616
+ **untyped metadata
617
+ ) {
618
+ (Discorb::VoiceState state) -> void
619
+ } -> Discorb::EventHandler
620
+ | (
621
+ :voice_server_mute_disable event_name,
622
+ ?id: Symbol?,
623
+ **untyped metadata
624
+ ) {
625
+ (Discorb::VoiceState state) -> void
626
+ } -> Discorb::EventHandler
627
+ | (
628
+ :voice_server_mute_update event_name,
629
+ ?id: Symbol?,
630
+ **untyped metadata
631
+ ) {
632
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> void
633
+ } -> Discorb::EventHandler
634
+ | (
635
+ :voice_self_mute_enable event_name,
636
+ ?id: Symbol?,
637
+ **untyped metadata
638
+ ) {
639
+ (Discorb::VoiceState state) -> void
640
+ } -> Discorb::EventHandler
641
+ | (
642
+ :voice_self_mute_disable event_name,
643
+ ?id: Symbol?,
644
+ **untyped metadata
645
+ ) {
646
+ (Discorb::VoiceState state) -> void
647
+ } -> Discorb::EventHandler
648
+ | (
649
+ :voice_self_mute_update event_name,
650
+ ?id: Symbol?,
651
+ **untyped metadata
652
+ ) {
653
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> void
654
+ } -> Discorb::EventHandler
655
+ | (
656
+ :voice_deaf_enable event_name,
657
+ ?id: Symbol?,
658
+ **untyped metadata
659
+ ) {
660
+ (Discorb::VoiceState state) -> void
661
+ } -> Discorb::EventHandler
662
+ | (
663
+ :voice_deaf_disable event_name,
664
+ ?id: Symbol?,
665
+ **untyped metadata
666
+ ) {
667
+ (Discorb::VoiceState state) -> void
668
+ } -> Discorb::EventHandler
669
+ | (
670
+ :voice_deaf_update event_name,
671
+ ?id: Symbol?,
672
+ **untyped metadata
673
+ ) {
674
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> void
675
+ } -> Discorb::EventHandler
676
+ | (
677
+ :voice_server_deaf_enable event_name,
678
+ ?id: Symbol?,
679
+ **untyped metadata
680
+ ) {
681
+ (Discorb::VoiceState state) -> void
682
+ } -> Discorb::EventHandler
683
+ | (
684
+ :voice_server_deaf_disable event_name,
685
+ ?id: Symbol?,
686
+ **untyped metadata
687
+ ) {
688
+ (Discorb::VoiceState state) -> void
689
+ } -> Discorb::EventHandler
690
+ | (
691
+ :voice_server_deaf_update event_name,
692
+ ?id: Symbol?,
693
+ **untyped metadata
694
+ ) {
695
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> void
696
+ } -> Discorb::EventHandler
697
+ | (
698
+ :voice_self_deaf_enable event_name,
699
+ ?id: Symbol?,
700
+ **untyped metadata
701
+ ) {
702
+ (Discorb::VoiceState state) -> void
703
+ } -> Discorb::EventHandler
704
+ | (
705
+ :voice_self_deaf_disable event_name,
706
+ ?id: Symbol?,
707
+ **untyped metadata
708
+ ) {
709
+ (Discorb::VoiceState state) -> void
710
+ } -> Discorb::EventHandler
711
+ | (
712
+ :voice_self_deaf_update event_name,
713
+ ?id: Symbol?,
714
+ **untyped metadata
715
+ ) {
716
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> void
717
+ } -> Discorb::EventHandler
718
+ | (
719
+ :voice_stream_start event_name,
720
+ ?id: Symbol?,
721
+ **untyped metadata
722
+ ) {
723
+ (Discorb::VoiceState state) -> void
724
+ } -> Discorb::EventHandler
725
+ | (
726
+ :voice_stream_end event_name,
727
+ ?id: Symbol?,
728
+ **untyped metadata
729
+ ) {
730
+ (Discorb::VoiceState state) -> void
731
+ } -> Discorb::EventHandler
732
+ | (
733
+ :voice_stream_update event_name,
734
+ ?id: Symbol?,
735
+ **untyped metadata
736
+ ) {
737
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> void
738
+ } -> Discorb::EventHandler
739
+ | (
740
+ :voice_video_start event_name,
741
+ ?id: Symbol?,
742
+ **untyped metadata
743
+ ) {
744
+ (Discorb::VoiceState state) -> void
745
+ } -> Discorb::EventHandler
746
+ | (
747
+ :voice_video_end event_name,
748
+ ?id: Symbol?,
749
+ **untyped metadata
750
+ ) {
751
+ (Discorb::VoiceState state) -> void
752
+ } -> Discorb::EventHandler
753
+ | (
754
+ :voice_video_update event_name,
755
+ ?id: Symbol?,
756
+ **untyped metadata
757
+ ) {
758
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> void
759
+ } -> Discorb::EventHandler
760
+ | (
761
+ :stage_instance_create event_name,
762
+ ?id: Symbol?,
763
+ **untyped metadata
764
+ ) {
765
+ (Discorb::StageInstance `instance`) -> void
766
+ } -> Discorb::EventHandler
767
+ | (
768
+ :stage_instance_delete event_name,
769
+ ?id: Symbol?,
770
+ **untyped metadata
771
+ ) {
772
+ (Discorb::StageInstance `instance`) -> void
773
+ } -> Discorb::EventHandler
774
+ | (
775
+ :stage_instance_update event_name,
776
+ ?id: Symbol?,
777
+ **untyped metadata
778
+ ) {
779
+ (Discorb::StageInstance before, Discorb::StageInstance after) -> void
780
+ } -> Discorb::EventHandler
781
+ | (
782
+ :voice_state_update event_name,
783
+ ?id: Symbol?,
784
+ **untyped metadata
785
+ ) {
786
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> void
787
+ } -> Discorb::EventHandler
788
+ | (
789
+ Symbol event_name,
790
+ ?id: Symbol?,
791
+ **untyped metadata
792
+ ) {
793
+ (*untyped) -> void
794
+ } -> Discorb::EventHandler
795
+
796
+ #
797
+ # Almost same as {#on}, but only triggers the event once.
798
+ #
799
+ # @param (see #on)
800
+ #
801
+ # @return [Discorb::EventHandler] The event.
802
+ def once:
803
+ (
804
+ :event_receive event_name,
805
+ ?id: Symbol?,
806
+ **untyped metadata
807
+ ) {
808
+ (Symbol event_name, Discorb::json data) -> void
809
+ } -> Discorb::EventHandler
810
+ | (
811
+ :ready event_name,
812
+ ?id: Symbol?,
813
+ **untyped metadata
814
+ ) {
815
+ -> void
816
+ } -> Discorb::EventHandler
817
+ | (
818
+ :standby event_name,
819
+ ?id: Symbol?,
820
+ **untyped metadata
821
+ ) {
822
+ -> void
823
+ } -> Discorb::EventHandler
824
+ | (
825
+ :resumed event_name,
826
+ ?id: Symbol?,
827
+ **untyped metadata
828
+ ) {
829
+ -> void
830
+ } -> Discorb::EventHandler
831
+ | (
832
+ :error event_name,
833
+ ?id: Symbol?,
834
+ **untyped metadata
835
+ ) {
836
+ (Symbol event_name, Array[Object] args, Exception error) -> void
837
+ } -> Discorb::EventHandler
838
+ | (
839
+ :setup event_name,
840
+ ?id: Symbol?,
841
+ **untyped metadata
842
+ ) {
843
+ -> void
844
+ } -> Discorb::EventHandler
845
+ | (
846
+ :shard_standby event_name,
847
+ ?id: Symbol?,
848
+ **untyped metadata
849
+ ) {
850
+ (Discorb::Shard shard) -> void
851
+ } -> Discorb::EventHandler
852
+ | (
853
+ :shard_resumed event_name,
854
+ ?id: Symbol?,
855
+ **untyped metadata
856
+ ) {
857
+ (Discorb::Shard shard) -> void
858
+ } -> Discorb::EventHandler
859
+ | (
860
+ :guild_join event_name,
861
+ ?id: Symbol?,
862
+ **untyped metadata
863
+ ) {
864
+ (Discorb::Guild guild) -> void
865
+ } -> Discorb::EventHandler
866
+ | (
867
+ :guild_available event_name,
868
+ ?id: Symbol?,
869
+ **untyped metadata
870
+ ) {
871
+ (Discorb::Guild guild) -> void
872
+ } -> Discorb::EventHandler
873
+ | (
874
+ :guild_update event_name,
875
+ ?id: Symbol?,
876
+ **untyped metadata
877
+ ) {
878
+ (Discorb::Guild before, Discorb::Guild after) -> void
879
+ } -> Discorb::EventHandler
880
+ | (
881
+ :guild_leave event_name,
882
+ ?id: Symbol?,
883
+ **untyped metadata
884
+ ) {
885
+ (Discorb::Guild guild) -> void
886
+ } -> Discorb::EventHandler
887
+ | (
888
+ :guild_destroy event_name,
889
+ ?id: Symbol?,
890
+ **untyped metadata
891
+ ) {
892
+ (Discorb::Guild guild) -> void
893
+ } -> Discorb::EventHandler
894
+ | (
895
+ :guild_integrations_update event_name,
896
+ ?id: Symbol?,
897
+ **untyped metadata
898
+ ) {
899
+ (Discorb::Guild guild) -> void
900
+ } -> Discorb::EventHandler
901
+ | (
902
+ :guild_ban_add event_name,
903
+ ?id: Symbol?,
904
+ **untyped metadata
905
+ ) {
906
+ (Discorb::Guild guild, Discorb::User user) -> void
907
+ } -> Discorb::EventHandler
908
+ | (
909
+ :guild_ban_remove event_name,
910
+ ?id: Symbol?,
911
+ **untyped metadata
912
+ ) {
913
+ (Discorb::Guild guild, Discorb::User user) -> void
914
+ } -> Discorb::EventHandler
915
+ | (
916
+ :channel_create event_name,
917
+ ?id: Symbol?,
918
+ **untyped metadata
919
+ ) {
920
+ (Discorb::Channel channel) -> void
921
+ } -> Discorb::EventHandler
922
+ | (
923
+ :channel_update event_name,
924
+ ?id: Symbol?,
925
+ **untyped metadata
926
+ ) {
927
+ (Discorb::Channel before, Discorb::Channel after) -> void
928
+ } -> Discorb::EventHandler
929
+ | (
930
+ :channel_delete event_name,
931
+ ?id: Symbol?,
932
+ **untyped metadata
933
+ ) {
934
+ (Discorb::Channel channel) -> void
935
+ } -> Discorb::EventHandler
936
+ | (
937
+ :webhooks_update event_name,
938
+ ?id: Symbol?,
939
+ **untyped metadata
940
+ ) {
941
+ (Discorb::Gateway::WebhooksUpdateEvent event) -> void
942
+ } -> Discorb::EventHandler
943
+ | (
944
+ :thread_new event_name,
945
+ ?id: Symbol?,
946
+ **untyped metadata
947
+ ) {
948
+ (Discorb::ThreadChannel thread) -> void
949
+ } -> Discorb::EventHandler
950
+ | (
951
+ :thread_join event_name,
952
+ ?id: Symbol?,
953
+ **untyped metadata
954
+ ) {
955
+ (Discorb::ThreadChannel thread) -> void
956
+ } -> Discorb::EventHandler
957
+ | (
958
+ :thread_delete event_name,
959
+ ?id: Symbol?,
960
+ **untyped metadata
961
+ ) {
962
+ (Discorb::ThreadChannel thread) -> void
963
+ } -> Discorb::EventHandler
964
+ | (
965
+ :thread_update event_name,
966
+ ?id: Symbol?,
967
+ **untyped metadata
968
+ ) {
969
+ (Discorb::ThreadChannel before, Discorb::ThreadChannel after) -> void
970
+ } -> Discorb::EventHandler
971
+ | (
972
+ :thread_members_update event_name,
973
+ ?id: Symbol?,
974
+ **untyped metadata
975
+ ) {
976
+ (
977
+ Discorb::ThreadChannel thread,
978
+ Array[Discorb::ThreadChannel::Member] added,
979
+ Array[Discorb::ThreadChannel::Member] removed
980
+ ) -> void
981
+ } -> Discorb::EventHandler
982
+ | (
983
+ :thread_member_update event_name,
984
+ ?id: Symbol?,
985
+ **untyped metadata
986
+ ) {
987
+ (
988
+ Discorb::ThreadChannel thread,
989
+ Discorb::ThreadChannel::Member before,
990
+ Discorb::ThreadChannel::Member after
991
+ ) -> void
992
+ } -> Discorb::EventHandler
993
+ | (
994
+ :integration_create event_name,
995
+ ?id: Symbol?,
996
+ **untyped metadata
997
+ ) {
998
+ (Discorb::Integration integration) -> void
999
+ } -> Discorb::EventHandler
1000
+ | (
1001
+ :integration_update event_name,
1002
+ ?id: Symbol?,
1003
+ **untyped metadata
1004
+ ) {
1005
+ (Discorb::Integration after) -> void
1006
+ } -> Discorb::EventHandler
1007
+ | (
1008
+ :integration_delete event_name,
1009
+ ?id: Symbol?,
1010
+ **untyped metadata
1011
+ ) {
1012
+ (Discorb::Integration integration) -> void
1013
+ } -> Discorb::EventHandler
1014
+ | (
1015
+ :message event_name,
1016
+ ?id: Symbol?,
1017
+ **untyped metadata
1018
+ ) {
1019
+ (Discorb::Message message) -> void
1020
+ } -> Discorb::EventHandler
1021
+ | (
1022
+ :message_update event_name,
1023
+ ?id: Symbol?,
1024
+ **untyped metadata
1025
+ ) {
1026
+ (Discorb::Gateway::MessageUpdateEvent event) -> void
1027
+ } -> Discorb::EventHandler
1028
+ | (
1029
+ :message_delete event_name,
1030
+ ?id: Symbol?,
1031
+ **untyped metadata
1032
+ ) {
1033
+ (
1034
+ Discorb::Message message,
1035
+ Discorb::Channel channel,
1036
+ Discorb::Guild guild
1037
+ ) -> void
1038
+ } -> Discorb::EventHandler
1039
+ | (
1040
+ :message_delete_id event_name,
1041
+ ?id: Symbol?,
1042
+ **untyped metadata
1043
+ ) {
1044
+ (
1045
+ Discorb::Snowflake message_id,
1046
+ Discorb::Channel channel,
1047
+ Discorb::Guild guild
1048
+ ) -> void
1049
+ } -> Discorb::EventHandler
1050
+ | (
1051
+ :message_delete_bulk event_name,
1052
+ ?id: Symbol?,
1053
+ **untyped metadata
1054
+ ) {
1055
+ (
1056
+ Array[Discorb::Message
1057
+ | Discorb::Gateway::UnknownDeleteBulkMessage] messages
1058
+ ) -> void
1059
+ } -> Discorb::EventHandler
1060
+ | (
1061
+ :message_pin_update event_name,
1062
+ ?id: Symbol?,
1063
+ **untyped metadata
1064
+ ) {
1065
+ (Discorb::Gateway::MessagePinEvent event) -> void
1066
+ } -> Discorb::EventHandler
1067
+ | (
1068
+ :typing_start event_name,
1069
+ ?id: Symbol?,
1070
+ **untyped metadata
1071
+ ) {
1072
+ (Discorb::Gateway::TypingStartEvent event) -> void
1073
+ } -> Discorb::EventHandler
1074
+ | (
1075
+ :reaction_add event_name,
1076
+ ?id: Symbol?,
1077
+ **untyped metadata
1078
+ ) {
1079
+ (Discorb::Gateway::ReactionEvent event) -> void
1080
+ } -> Discorb::EventHandler
1081
+ | (
1082
+ :reaction_remove event_name,
1083
+ ?id: Symbol?,
1084
+ **untyped metadata
1085
+ ) {
1086
+ (Discorb::Gateway::ReactionEvent event) -> void
1087
+ } -> Discorb::EventHandler
1088
+ | (
1089
+ :reaction_remove_all event_name,
1090
+ ?id: Symbol?,
1091
+ **untyped metadata
1092
+ ) {
1093
+ (Discorb::Gateway::ReactionRemoveAllEvent event) -> void
1094
+ } -> Discorb::EventHandler
1095
+ | (
1096
+ :reaction_remove_emoji event_name,
1097
+ ?id: Symbol?,
1098
+ **untyped metadata
1099
+ ) {
1100
+ (Discorb::Gateway::ReactionRemoveEmojiEvent event) -> void
1101
+ } -> Discorb::EventHandler
1102
+ | (
1103
+ :role_create event_name,
1104
+ ?id: Symbol?,
1105
+ **untyped metadata
1106
+ ) {
1107
+ (Discorb::Role role) -> void
1108
+ } -> Discorb::EventHandler
1109
+ | (
1110
+ :role_update event_name,
1111
+ ?id: Symbol?,
1112
+ **untyped metadata
1113
+ ) {
1114
+ (Discorb::Role before, Discorb::Role after) -> void
1115
+ } -> Discorb::EventHandler
1116
+ | (
1117
+ :role_remove event_name,
1118
+ ?id: Symbol?,
1119
+ **untyped metadata
1120
+ ) {
1121
+ (Discorb::Role role) -> void
1122
+ } -> Discorb::EventHandler
1123
+ | (
1124
+ :member_add event_name,
1125
+ ?id: Symbol?,
1126
+ **untyped metadata
1127
+ ) {
1128
+ (Discorb::Member member) -> void
1129
+ } -> Discorb::EventHandler
1130
+ | (
1131
+ :member_update event_name,
1132
+ ?id: Symbol?,
1133
+ **untyped metadata
1134
+ ) {
1135
+ (Discorb::Member before, Discorb::Member after) -> void
1136
+ } -> Discorb::EventHandler
1137
+ | (
1138
+ :member_remove event_name,
1139
+ ?id: Symbol?,
1140
+ **untyped metadata
1141
+ ) {
1142
+ (Discorb::Member member) -> void
1143
+ } -> Discorb::EventHandler
1144
+ | (
1145
+ :role_create event_name,
1146
+ ?id: Symbol?,
1147
+ **untyped metadata
1148
+ ) {
1149
+ (Discorb::Role role) -> void
1150
+ } -> Discorb::EventHandler
1151
+ | (
1152
+ :role_update event_name,
1153
+ ?id: Symbol?,
1154
+ **untyped metadata
1155
+ ) {
1156
+ (Discorb::Role before, Discorb::Role after) -> void
1157
+ } -> Discorb::EventHandler
1158
+ | (
1159
+ :role_remove event_name,
1160
+ ?id: Symbol?,
1161
+ **untyped metadata
1162
+ ) {
1163
+ (Discorb::Role role) -> void
1164
+ } -> Discorb::EventHandler
1165
+ | (
1166
+ :invite_create event_name,
1167
+ ?id: Symbol?,
1168
+ **untyped metadata
1169
+ ) {
1170
+ (Discorb::Invite invite) -> void
1171
+ } -> Discorb::EventHandler
1172
+ | (
1173
+ :invite_delete event_name,
1174
+ ?id: Symbol?,
1175
+ **untyped metadata
1176
+ ) {
1177
+ (Discorb::Invite invite) -> void
1178
+ } -> Discorb::EventHandler
1179
+ | (
1180
+ :interaction_create event_name,
1181
+ ?id: Symbol?,
1182
+ **untyped metadata
1183
+ ) {
1184
+ (Discorb::Interaction interaction) -> void
1185
+ } -> Discorb::EventHandler
1186
+ | (
1187
+ :application_command event_name,
1188
+ ?id: Symbol?,
1189
+ **untyped metadata
1190
+ ) {
1191
+ (Discorb::CommandInteraction interaction) -> void
1192
+ } -> Discorb::EventHandler
1193
+ | (
1194
+ :slash_command event_name,
1195
+ ?id: Symbol?,
1196
+ **untyped metadata
1197
+ ) {
1198
+ (Discorb::CommandInteraction::ChatInputCommand interaction) -> void
1199
+ } -> Discorb::EventHandler
1200
+ | (
1201
+ :message_command event_name,
1202
+ ?id: Symbol?,
1203
+ **untyped metadata
1204
+ ) {
1205
+ (Discorb::CommandInteraction::MessageMenuCommand interaction) -> void
1206
+ } -> Discorb::EventHandler
1207
+ | (
1208
+ :user_command event_name,
1209
+ ?id: Symbol?,
1210
+ **untyped metadata
1211
+ ) {
1212
+ (Discorb::CommandInteraction::UserMenuCommand interaction) -> void
1213
+ } -> Discorb::EventHandler
1214
+ | (
1215
+ :button_click event_name,
1216
+ ?id: Symbol?,
1217
+ **untyped metadata
1218
+ ) {
1219
+ (Discorb::MessageComponentInteraction::Button interaction) -> void
1220
+ } -> Discorb::EventHandler
1221
+ | (
1222
+ :select_menu_select event_name,
1223
+ ?id: Symbol?,
1224
+ **untyped metadata
1225
+ ) {
1226
+ (Discorb::MessageComponentInteraction::SelectMenu interaction) -> void
1227
+ } -> Discorb::EventHandler
1228
+ | (
1229
+ :form_submit event_name,
1230
+ ?id: Symbol?,
1231
+ **untyped metadata
1232
+ ) {
1233
+ (Discorb::ModalInteraction interaction) -> void
1234
+ } -> Discorb::EventHandler
1235
+ | (
1236
+ :scheduled_event_create event_name,
1237
+ ?id: Symbol?,
1238
+ **untyped metadata
1239
+ ) {
1240
+ (Discorb::ScheduledEvent event) -> void
1241
+ } -> Discorb::EventHandler
1242
+ | (
1243
+ :scheduled_event_cancel event_name,
1244
+ ?id: Symbol?,
1245
+ **untyped metadata
1246
+ ) {
1247
+ (Discorb::ScheduledEvent event) -> void
1248
+ } -> Discorb::EventHandler
1249
+ | (
1250
+ :scheduled_event_edit event_name,
1251
+ ?id: Symbol?,
1252
+ **untyped metadata
1253
+ ) {
1254
+ (Discorb::ScheduledEvent before, Discorb::ScheduledEvent after) -> void
1255
+ } -> Discorb::EventHandler
1256
+ | (
1257
+ :scheduled_event_start event_name,
1258
+ ?id: Symbol?,
1259
+ **untyped metadata
1260
+ ) {
1261
+ (Discorb::ScheduledEvent event) -> void
1262
+ } -> Discorb::EventHandler
1263
+ | (
1264
+ :scheduled_event_end event_name,
1265
+ ?id: Symbol?,
1266
+ **untyped metadata
1267
+ ) {
1268
+ (Discorb::ScheduledEvent event) -> void
1269
+ } -> Discorb::EventHandler
1270
+ | (
1271
+ :auto_moderation_rule_create event_name,
1272
+ ?id: Symbol?,
1273
+ **untyped metadata
1274
+ ) {
1275
+ (Discorb::AutoModRule rule) -> void
1276
+ } -> Discorb::EventHandler
1277
+ | (
1278
+ :auto_moderation_rule_update event_name,
1279
+ ?id: Symbol?,
1280
+ **untyped metadata
1281
+ ) {
1282
+ (Discorb::AutoModRule rule) -> void
1283
+ } -> Discorb::EventHandler
1284
+ | (
1285
+ :auto_moderation_rule_delete event_name,
1286
+ ?id: Symbol?,
1287
+ **untyped metadata
1288
+ ) {
1289
+ (Discorb::AutoModRule rule) -> void
1290
+ } -> Discorb::EventHandler
1291
+ | (
1292
+ :auto_moderation_action_execution event_name,
1293
+ ?id: Symbol?,
1294
+ **untyped metadata
1295
+ ) {
1296
+ (Discorb::Gateway::AutoModerationActionExecutionEvent event) -> void
1297
+ } -> Discorb::EventHandler
1298
+ | (
1299
+ :guild_create event_name,
1300
+ ?id: Symbol?,
1301
+ **untyped metadata
1302
+ ) {
1303
+ (Discorb::Guild guild) -> void
1304
+ } -> Discorb::EventHandler
1305
+ | (
1306
+ :guild_delete event_name,
1307
+ ?id: Symbol?,
1308
+ **untyped metadata
1309
+ ) {
1310
+ (Discorb::Guild guild) -> void
1311
+ } -> Discorb::EventHandler
1312
+ | (
1313
+ :thread_create event_name,
1314
+ ?id: Symbol?,
1315
+ **untyped metadata
1316
+ ) {
1317
+ (Discorb::ThreadChannel thread) -> void
1318
+ } -> Discorb::EventHandler
1319
+ | (
1320
+ :scheduled_event_update event_name,
1321
+ ?id: Symbol?,
1322
+ **untyped metadata
1323
+ ) {
1324
+ (Discorb::ScheduledEvent before, Discorb::ScheduledEvent after) -> void
1325
+ } -> Discorb::EventHandler
1326
+ | (
1327
+ :voice_channel_connect event_name,
1328
+ ?id: Symbol?,
1329
+ **untyped metadata
1330
+ ) {
1331
+ -> void
1332
+ } -> Discorb::EventHandler
1333
+ | (
1334
+ :voice_channel_disconnect event_name,
1335
+ ?id: Symbol?,
1336
+ **untyped metadata
1337
+ ) {
1338
+ -> void
1339
+ } -> Discorb::EventHandler
1340
+ | (
1341
+ :voice_channel_move event_name,
1342
+ ?id: Symbol?,
1343
+ **untyped metadata
1344
+ ) {
1345
+ -> void
1346
+ } -> Discorb::EventHandler
1347
+ | (
1348
+ :voice_channel_update event_name,
1349
+ ?id: Symbol?,
1350
+ **untyped metadata
1351
+ ) {
1352
+ -> void
1353
+ } -> Discorb::EventHandler
1354
+ | (
1355
+ :voice_mute_disable event_name,
1356
+ ?id: Symbol?,
1357
+ **untyped metadata
1358
+ ) {
1359
+ (Discorb::VoiceState state) -> void
1360
+ } -> Discorb::EventHandler
1361
+ | (
1362
+ :voice_mute_enable event_name,
1363
+ ?id: Symbol?,
1364
+ **untyped metadata
1365
+ ) {
1366
+ (Discorb::VoiceState state) -> void
1367
+ } -> Discorb::EventHandler
1368
+ | (
1369
+ :voice_mute_update event_name,
1370
+ ?id: Symbol?,
1371
+ **untyped metadata
1372
+ ) {
1373
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> void
1374
+ } -> Discorb::EventHandler
1375
+ | (
1376
+ :voice_server_mute_enable event_name,
1377
+ ?id: Symbol?,
1378
+ **untyped metadata
1379
+ ) {
1380
+ (Discorb::VoiceState state) -> void
1381
+ } -> Discorb::EventHandler
1382
+ | (
1383
+ :voice_server_mute_disable event_name,
1384
+ ?id: Symbol?,
1385
+ **untyped metadata
1386
+ ) {
1387
+ (Discorb::VoiceState state) -> void
1388
+ } -> Discorb::EventHandler
1389
+ | (
1390
+ :voice_server_mute_update event_name,
1391
+ ?id: Symbol?,
1392
+ **untyped metadata
1393
+ ) {
1394
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> void
1395
+ } -> Discorb::EventHandler
1396
+ | (
1397
+ :voice_self_mute_enable event_name,
1398
+ ?id: Symbol?,
1399
+ **untyped metadata
1400
+ ) {
1401
+ (Discorb::VoiceState state) -> void
1402
+ } -> Discorb::EventHandler
1403
+ | (
1404
+ :voice_self_mute_disable event_name,
1405
+ ?id: Symbol?,
1406
+ **untyped metadata
1407
+ ) {
1408
+ (Discorb::VoiceState state) -> void
1409
+ } -> Discorb::EventHandler
1410
+ | (
1411
+ :voice_self_mute_update event_name,
1412
+ ?id: Symbol?,
1413
+ **untyped metadata
1414
+ ) {
1415
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> void
1416
+ } -> Discorb::EventHandler
1417
+ | (
1418
+ :voice_deaf_enable event_name,
1419
+ ?id: Symbol?,
1420
+ **untyped metadata
1421
+ ) {
1422
+ (Discorb::VoiceState state) -> void
1423
+ } -> Discorb::EventHandler
1424
+ | (
1425
+ :voice_deaf_disable event_name,
1426
+ ?id: Symbol?,
1427
+ **untyped metadata
1428
+ ) {
1429
+ (Discorb::VoiceState state) -> void
1430
+ } -> Discorb::EventHandler
1431
+ | (
1432
+ :voice_deaf_update event_name,
1433
+ ?id: Symbol?,
1434
+ **untyped metadata
1435
+ ) {
1436
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> void
1437
+ } -> Discorb::EventHandler
1438
+ | (
1439
+ :voice_server_deaf_enable event_name,
1440
+ ?id: Symbol?,
1441
+ **untyped metadata
1442
+ ) {
1443
+ (Discorb::VoiceState state) -> void
1444
+ } -> Discorb::EventHandler
1445
+ | (
1446
+ :voice_server_deaf_disable event_name,
1447
+ ?id: Symbol?,
1448
+ **untyped metadata
1449
+ ) {
1450
+ (Discorb::VoiceState state) -> void
1451
+ } -> Discorb::EventHandler
1452
+ | (
1453
+ :voice_server_deaf_update event_name,
1454
+ ?id: Symbol?,
1455
+ **untyped metadata
1456
+ ) {
1457
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> void
1458
+ } -> Discorb::EventHandler
1459
+ | (
1460
+ :voice_self_deaf_enable event_name,
1461
+ ?id: Symbol?,
1462
+ **untyped metadata
1463
+ ) {
1464
+ (Discorb::VoiceState state) -> void
1465
+ } -> Discorb::EventHandler
1466
+ | (
1467
+ :voice_self_deaf_disable event_name,
1468
+ ?id: Symbol?,
1469
+ **untyped metadata
1470
+ ) {
1471
+ (Discorb::VoiceState state) -> void
1472
+ } -> Discorb::EventHandler
1473
+ | (
1474
+ :voice_self_deaf_update event_name,
1475
+ ?id: Symbol?,
1476
+ **untyped metadata
1477
+ ) {
1478
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> void
1479
+ } -> Discorb::EventHandler
1480
+ | (
1481
+ :voice_stream_start event_name,
1482
+ ?id: Symbol?,
1483
+ **untyped metadata
1484
+ ) {
1485
+ (Discorb::VoiceState state) -> void
1486
+ } -> Discorb::EventHandler
1487
+ | (
1488
+ :voice_stream_end event_name,
1489
+ ?id: Symbol?,
1490
+ **untyped metadata
1491
+ ) {
1492
+ (Discorb::VoiceState state) -> void
1493
+ } -> Discorb::EventHandler
1494
+ | (
1495
+ :voice_stream_update event_name,
1496
+ ?id: Symbol?,
1497
+ **untyped metadata
1498
+ ) {
1499
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> void
1500
+ } -> Discorb::EventHandler
1501
+ | (
1502
+ :voice_video_start event_name,
1503
+ ?id: Symbol?,
1504
+ **untyped metadata
1505
+ ) {
1506
+ (Discorb::VoiceState state) -> void
1507
+ } -> Discorb::EventHandler
1508
+ | (
1509
+ :voice_video_end event_name,
1510
+ ?id: Symbol?,
1511
+ **untyped metadata
1512
+ ) {
1513
+ (Discorb::VoiceState state) -> void
1514
+ } -> Discorb::EventHandler
1515
+ | (
1516
+ :voice_video_update event_name,
1517
+ ?id: Symbol?,
1518
+ **untyped metadata
1519
+ ) {
1520
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> void
1521
+ } -> Discorb::EventHandler
1522
+ | (
1523
+ :stage_instance_create event_name,
1524
+ ?id: Symbol?,
1525
+ **untyped metadata
1526
+ ) {
1527
+ (Discorb::StageInstance `instance`) -> void
1528
+ } -> Discorb::EventHandler
1529
+ | (
1530
+ :stage_instance_delete event_name,
1531
+ ?id: Symbol?,
1532
+ **untyped metadata
1533
+ ) {
1534
+ (Discorb::StageInstance `instance`) -> void
1535
+ } -> Discorb::EventHandler
1536
+ | (
1537
+ :stage_instance_update event_name,
1538
+ ?id: Symbol?,
1539
+ **untyped metadata
1540
+ ) {
1541
+ (Discorb::StageInstance before, Discorb::StageInstance after) -> void
1542
+ } -> Discorb::EventHandler
1543
+ | (
1544
+ :voice_state_update event_name,
1545
+ ?id: Symbol?,
1546
+ **untyped metadata
1547
+ ) {
1548
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> void
1549
+ } -> Discorb::EventHandler
1550
+ | (
1551
+ Symbol event_name,
1552
+ ?id: Symbol?,
1553
+ **untyped metadata
1554
+ ) {
1555
+ (*untyped) -> void
1556
+ } -> Discorb::EventHandler
1557
+
1558
+ #
1559
+ # Remove event by ID.
1560
+ #
1561
+ # @param [Symbol] event_name The name of the event.
1562
+ # @param [Symbol] id The ID of the event.
1563
+ def remove_event: (Symbol event_name, Symbol id) -> void
1564
+
1565
+ #
1566
+ # Dispatch an event.
1567
+ # @async
1568
+ #
1569
+ # @param [Symbol] event_name The name of the event.
1570
+ # @param [Object] args The arguments to pass to the event.
1571
+ #
1572
+ # @return [Async::Task<void>] The task.
1573
+ def dispatch: (Symbol event_name, *untyped args) -> Async::Task[void]
1574
+
1575
+ #
1576
+ # Fetch user from ID.
1577
+ # @async
1578
+ #
1579
+ # @param [#to_s] id <description>
1580
+ #
1581
+ # @return [Async::Task<Discorb::User>] The user.
1582
+ #
1583
+ # @raise [Discorb::NotFoundError] If the user doesn't exist.
1584
+ def fetch_user: (_ToS id) -> Async::Task[Discorb::User]
1585
+
1586
+ #
1587
+ # Fetch channel from ID.
1588
+ # @async
1589
+ #
1590
+ # @param [#to_s] id The ID of the channel.
1591
+ #
1592
+ # @return [Async::Task<Discorb::Channel>] The channel.
1593
+ #
1594
+ # @raise [Discorb::NotFoundError] If the channel doesn't exist.
1595
+ def fetch_channel: (_ToS id) -> Async::Task[Discorb::Channel]
1596
+
1597
+ #
1598
+ # Fetch guild from ID.
1599
+ # @async
1600
+ #
1601
+ # @param [#to_s] id <description>
1602
+ #
1603
+ # @return [Async::Task<Discorb::Guild>] The guild.
1604
+ #
1605
+ # @raise [Discorb::NotFoundError] If the guild doesn't exist.
1606
+ def fetch_guild: (_ToS id) -> Async::Task[Discorb::Guild]
1607
+
1608
+ #
1609
+ # Fetch invite from code.
1610
+ # @async
1611
+ #
1612
+ # @param [String] code The code of the invite.
1613
+ # @param [Boolean] with_count Whether to include the count of the invite.
1614
+ # @param [Boolean] with_expiration Whether to include the expiration of the invite.
1615
+ #
1616
+ # @return [Async::Task<Discorb::Invite>] The invite.
1617
+ def fetch_invite: (
1618
+ String code,
1619
+ ?with_count: bool,
1620
+ ?with_expiration: bool
1621
+ ) -> Async::Task[Discorb::Invite]
1622
+
1623
+ #
1624
+ # Fetch webhook from ID.
1625
+ # If application was cached, it will be used.
1626
+ # @async
1627
+ #
1628
+ # @param [Boolean] force Whether to force the fetch.
1629
+ #
1630
+ # @return [Async::Task<Discorb::Application>] The application.
1631
+ def fetch_application: (?force: bool) -> Async::Task[Discorb::Application]
1632
+
1633
+ #
1634
+ # Fetch nitro sticker pack from ID.
1635
+ # @async
1636
+ #
1637
+ # @return [Async::Task<Array<Discorb::Sticker::Pack>>] The packs.
1638
+ def fetch_nitro_sticker_packs: -> Async::Task[::Array[Discorb::Sticker::Pack]]
1639
+
1640
+ #
1641
+ # Update presence of the client.
1642
+ #
1643
+ # @param [Discorb::Activity] activity The activity to update.
1644
+ # @param [:online, :idle, :dnd, :invisible] status The status to update.
1645
+ def update_presence: (
1646
+ ?Discorb::Activity? activity,
1647
+ ?status: Symbol?
1648
+ ) -> (Async::Task[void] | void)
1649
+
1650
+ alias change_presence update_presence
1651
+
1652
+ #
1653
+ # Method to wait for a event.
1654
+ # @async
1655
+ #
1656
+ # @param [Symbol] event The name of the event.
1657
+ # @param [Integer] timeout The timeout in seconds.
1658
+ # @param [Proc] check The check to use.
1659
+ #
1660
+ # @return [Async::Task<Object>] The result of the event.
1661
+ #
1662
+ # @raise [Discorb::TimeoutError] If the event didn't occur in time.
1663
+ def event_lock:
1664
+ (
1665
+ :event_receive event,
1666
+ ?Integer? timeout
1667
+ ) {
1668
+ (Symbol event_name, Discorb::json data) -> boolish
1669
+ } -> Async::Task[[Symbol, Discorb::json]]
1670
+ | (:ready event, ?Integer? timeout) { -> boolish } -> Async::Task[void]
1671
+ | (:standby event, ?Integer? timeout) { -> boolish } -> Async::Task[void]
1672
+ | (:resumed event, ?Integer? timeout) { -> boolish } -> Async::Task[void]
1673
+ | (
1674
+ :error event,
1675
+ ?Integer? timeout
1676
+ ) {
1677
+ (Symbol event_name, Array[Object] args, Exception error) -> boolish
1678
+ } -> Async::Task[[Symbol, Array[Object], Exception]]
1679
+ | (:setup event, ?Integer? timeout) { -> boolish } -> Async::Task[void]
1680
+ | (
1681
+ :shard_standby event,
1682
+ ?Integer? timeout
1683
+ ) {
1684
+ (Discorb::Shard shard) -> boolish
1685
+ } -> Async::Task[Discorb::Shard]
1686
+ | (
1687
+ :shard_resumed event,
1688
+ ?Integer? timeout
1689
+ ) {
1690
+ (Discorb::Shard shard) -> boolish
1691
+ } -> Async::Task[Discorb::Shard]
1692
+ | (
1693
+ :guild_join event,
1694
+ ?Integer? timeout
1695
+ ) {
1696
+ (Discorb::Guild guild) -> boolish
1697
+ } -> Async::Task[Discorb::Guild]
1698
+ | (
1699
+ :guild_available event,
1700
+ ?Integer? timeout
1701
+ ) {
1702
+ (Discorb::Guild guild) -> boolish
1703
+ } -> Async::Task[Discorb::Guild]
1704
+ | (
1705
+ :guild_update event,
1706
+ ?Integer? timeout
1707
+ ) {
1708
+ (Discorb::Guild before, Discorb::Guild after) -> boolish
1709
+ } -> Async::Task[[Discorb::Guild, Discorb::Guild]]
1710
+ | (
1711
+ :guild_leave event,
1712
+ ?Integer? timeout
1713
+ ) {
1714
+ (Discorb::Guild guild) -> boolish
1715
+ } -> Async::Task[Discorb::Guild]
1716
+ | (
1717
+ :guild_destroy event,
1718
+ ?Integer? timeout
1719
+ ) {
1720
+ (Discorb::Guild guild) -> boolish
1721
+ } -> Async::Task[Discorb::Guild]
1722
+ | (
1723
+ :guild_integrations_update event,
1724
+ ?Integer? timeout
1725
+ ) {
1726
+ (Discorb::Guild guild) -> boolish
1727
+ } -> Async::Task[Discorb::Guild]
1728
+ | (
1729
+ :guild_ban_add event,
1730
+ ?Integer? timeout
1731
+ ) {
1732
+ (Discorb::Guild guild, Discorb::User user) -> boolish
1733
+ } -> Async::Task[[Discorb::Guild, Discorb::User]]
1734
+ | (
1735
+ :guild_ban_remove event,
1736
+ ?Integer? timeout
1737
+ ) {
1738
+ (Discorb::Guild guild, Discorb::User user) -> boolish
1739
+ } -> Async::Task[[Discorb::Guild, Discorb::User]]
1740
+ | (
1741
+ :channel_create event,
1742
+ ?Integer? timeout
1743
+ ) {
1744
+ (Discorb::Channel channel) -> boolish
1745
+ } -> Async::Task[Discorb::Channel]
1746
+ | (
1747
+ :channel_update event,
1748
+ ?Integer? timeout
1749
+ ) {
1750
+ (Discorb::Channel before, Discorb::Channel after) -> boolish
1751
+ } -> Async::Task[[Discorb::Channel, Discorb::Channel]]
1752
+ | (
1753
+ :channel_delete event,
1754
+ ?Integer? timeout
1755
+ ) {
1756
+ (Discorb::Channel channel) -> boolish
1757
+ } -> Async::Task[Discorb::Channel]
1758
+ | (
1759
+ :webhooks_update event,
1760
+ ?Integer? timeout
1761
+ ) {
1762
+ (Discorb::Gateway::WebhooksUpdateEvent event) -> boolish
1763
+ } -> Async::Task[Discorb::Gateway::WebhooksUpdateEvent]
1764
+ | (
1765
+ :thread_new event,
1766
+ ?Integer? timeout
1767
+ ) {
1768
+ (Discorb::ThreadChannel thread) -> boolish
1769
+ } -> Async::Task[Discorb::ThreadChannel]
1770
+ | (
1771
+ :thread_join event,
1772
+ ?Integer? timeout
1773
+ ) {
1774
+ (Discorb::ThreadChannel thread) -> boolish
1775
+ } -> Async::Task[Discorb::ThreadChannel]
1776
+ | (
1777
+ :thread_delete event,
1778
+ ?Integer? timeout
1779
+ ) {
1780
+ (Discorb::ThreadChannel thread) -> boolish
1781
+ } -> Async::Task[Discorb::ThreadChannel]
1782
+ | (
1783
+ :thread_update event,
1784
+ ?Integer? timeout
1785
+ ) {
1786
+ (Discorb::ThreadChannel before, Discorb::ThreadChannel after) -> boolish
1787
+ } -> Async::Task[[Discorb::ThreadChannel, Discorb::ThreadChannel]]
1788
+ | (
1789
+ :thread_members_update event,
1790
+ ?Integer? timeout
1791
+ ) {
1792
+ (
1793
+ Discorb::ThreadChannel thread,
1794
+ Array[Discorb::ThreadChannel::Member] added,
1795
+ Array[Discorb::ThreadChannel::Member] removed
1796
+ ) -> boolish
1797
+ } -> Async::Task[[Discorb::ThreadChannel, Array[Discorb::ThreadChannel::Member], Array[Discorb::ThreadChannel::Member]]]
1798
+ | (
1799
+ :thread_member_update event,
1800
+ ?Integer? timeout
1801
+ ) {
1802
+ (
1803
+ Discorb::ThreadChannel thread,
1804
+ Discorb::ThreadChannel::Member before,
1805
+ Discorb::ThreadChannel::Member after
1806
+ ) -> boolish
1807
+ } -> Async::Task[[Discorb::ThreadChannel, Discorb::ThreadChannel::Member, Discorb::ThreadChannel::Member]]
1808
+ | (
1809
+ :integration_create event,
1810
+ ?Integer? timeout
1811
+ ) {
1812
+ (Discorb::Integration integration) -> boolish
1813
+ } -> Async::Task[Discorb::Integration]
1814
+ | (
1815
+ :integration_update event,
1816
+ ?Integer? timeout
1817
+ ) {
1818
+ (Discorb::Integration after) -> boolish
1819
+ } -> Async::Task[Discorb::Integration]
1820
+ | (
1821
+ :integration_delete event,
1822
+ ?Integer? timeout
1823
+ ) {
1824
+ (Discorb::Integration integration) -> boolish
1825
+ } -> Async::Task[Discorb::Integration]
1826
+ | (
1827
+ :message event,
1828
+ ?Integer? timeout
1829
+ ) {
1830
+ (Discorb::Message message) -> boolish
1831
+ } -> Async::Task[Discorb::Message]
1832
+ | (
1833
+ :message_update event,
1834
+ ?Integer? timeout
1835
+ ) {
1836
+ (Discorb::Gateway::MessageUpdateEvent event) -> boolish
1837
+ } -> Async::Task[Discorb::Gateway::MessageUpdateEvent]
1838
+ | (
1839
+ :message_delete event,
1840
+ ?Integer? timeout
1841
+ ) {
1842
+ (
1843
+ Discorb::Message message,
1844
+ Discorb::Channel channel,
1845
+ Discorb::Guild guild
1846
+ ) -> boolish
1847
+ } -> Async::Task[[Discorb::Message, Discorb::Channel, Discorb::Guild]]
1848
+ | (
1849
+ :message_delete_id event,
1850
+ ?Integer? timeout
1851
+ ) {
1852
+ (
1853
+ Discorb::Snowflake message_id,
1854
+ Discorb::Channel channel,
1855
+ Discorb::Guild guild
1856
+ ) -> boolish
1857
+ } -> Async::Task[[Discorb::Snowflake, Discorb::Channel, Discorb::Guild]]
1858
+ | (
1859
+ :message_delete_bulk event,
1860
+ ?Integer? timeout
1861
+ ) {
1862
+ (
1863
+ Array[Discorb::Message
1864
+ | Discorb::Gateway::UnknownDeleteBulkMessage] messages
1865
+ ) -> boolish
1866
+ } -> Async::Task[Array[(Discorb::Message
1867
+ | Discorb::Gateway::UnknownDeleteBulkMessage)]]
1868
+ | (
1869
+ :message_pin_update event,
1870
+ ?Integer? timeout
1871
+ ) {
1872
+ (Discorb::Gateway::MessagePinEvent event) -> boolish
1873
+ } -> Async::Task[Discorb::Gateway::MessagePinEvent]
1874
+ | (
1875
+ :typing_start event,
1876
+ ?Integer? timeout
1877
+ ) {
1878
+ (Discorb::Gateway::TypingStartEvent event) -> boolish
1879
+ } -> Async::Task[Discorb::Gateway::TypingStartEvent]
1880
+ | (
1881
+ :reaction_add event,
1882
+ ?Integer? timeout
1883
+ ) {
1884
+ (Discorb::Gateway::ReactionEvent event) -> boolish
1885
+ } -> Async::Task[Discorb::Gateway::ReactionEvent]
1886
+ | (
1887
+ :reaction_remove event,
1888
+ ?Integer? timeout
1889
+ ) {
1890
+ (Discorb::Gateway::ReactionEvent event) -> boolish
1891
+ } -> Async::Task[Discorb::Gateway::ReactionEvent]
1892
+ | (
1893
+ :reaction_remove_all event,
1894
+ ?Integer? timeout
1895
+ ) {
1896
+ (Discorb::Gateway::ReactionRemoveAllEvent event) -> boolish
1897
+ } -> Async::Task[Discorb::Gateway::ReactionRemoveAllEvent]
1898
+ | (
1899
+ :reaction_remove_emoji event,
1900
+ ?Integer? timeout
1901
+ ) {
1902
+ (Discorb::Gateway::ReactionRemoveEmojiEvent event) -> boolish
1903
+ } -> Async::Task[Discorb::Gateway::ReactionRemoveEmojiEvent]
1904
+ | (
1905
+ :role_create event,
1906
+ ?Integer? timeout
1907
+ ) {
1908
+ (Discorb::Role role) -> boolish
1909
+ } -> Async::Task[Discorb::Role]
1910
+ | (
1911
+ :role_update event,
1912
+ ?Integer? timeout
1913
+ ) {
1914
+ (Discorb::Role before, Discorb::Role after) -> boolish
1915
+ } -> Async::Task[[Discorb::Role, Discorb::Role]]
1916
+ | (
1917
+ :role_remove event,
1918
+ ?Integer? timeout
1919
+ ) {
1920
+ (Discorb::Role role) -> boolish
1921
+ } -> Async::Task[Discorb::Role]
1922
+ | (
1923
+ :member_add event,
1924
+ ?Integer? timeout
1925
+ ) {
1926
+ (Discorb::Member member) -> boolish
1927
+ } -> Async::Task[Discorb::Member]
1928
+ | (
1929
+ :member_update event,
1930
+ ?Integer? timeout
1931
+ ) {
1932
+ (Discorb::Member before, Discorb::Member after) -> boolish
1933
+ } -> Async::Task[[Discorb::Member, Discorb::Member]]
1934
+ | (
1935
+ :member_remove event,
1936
+ ?Integer? timeout
1937
+ ) {
1938
+ (Discorb::Member member) -> boolish
1939
+ } -> Async::Task[Discorb::Member]
1940
+ | (
1941
+ :role_create event,
1942
+ ?Integer? timeout
1943
+ ) {
1944
+ (Discorb::Role role) -> boolish
1945
+ } -> Async::Task[Discorb::Role]
1946
+ | (
1947
+ :role_update event,
1948
+ ?Integer? timeout
1949
+ ) {
1950
+ (Discorb::Role before, Discorb::Role after) -> boolish
1951
+ } -> Async::Task[[Discorb::Role, Discorb::Role]]
1952
+ | (
1953
+ :role_remove event,
1954
+ ?Integer? timeout
1955
+ ) {
1956
+ (Discorb::Role role) -> boolish
1957
+ } -> Async::Task[Discorb::Role]
1958
+ | (
1959
+ :invite_create event,
1960
+ ?Integer? timeout
1961
+ ) {
1962
+ (Discorb::Invite invite) -> boolish
1963
+ } -> Async::Task[Discorb::Invite]
1964
+ | (
1965
+ :invite_delete event,
1966
+ ?Integer? timeout
1967
+ ) {
1968
+ (Discorb::Invite invite) -> boolish
1969
+ } -> Async::Task[Discorb::Invite]
1970
+ | (
1971
+ :interaction_create event,
1972
+ ?Integer? timeout
1973
+ ) {
1974
+ (Discorb::Interaction interaction) -> boolish
1975
+ } -> Async::Task[Discorb::Interaction]
1976
+ | (
1977
+ :application_command event,
1978
+ ?Integer? timeout
1979
+ ) {
1980
+ (Discorb::CommandInteraction interaction) -> boolish
1981
+ } -> Async::Task[Discorb::CommandInteraction]
1982
+ | (
1983
+ :slash_command event,
1984
+ ?Integer? timeout
1985
+ ) {
1986
+ (Discorb::CommandInteraction::ChatInputCommand interaction) -> boolish
1987
+ } -> Async::Task[Discorb::CommandInteraction::ChatInputCommand]
1988
+ | (
1989
+ :message_command event,
1990
+ ?Integer? timeout
1991
+ ) {
1992
+ (Discorb::CommandInteraction::MessageMenuCommand interaction) -> boolish
1993
+ } -> Async::Task[Discorb::CommandInteraction::MessageMenuCommand]
1994
+ | (
1995
+ :user_command event,
1996
+ ?Integer? timeout
1997
+ ) {
1998
+ (Discorb::CommandInteraction::UserMenuCommand interaction) -> boolish
1999
+ } -> Async::Task[Discorb::CommandInteraction::UserMenuCommand]
2000
+ | (
2001
+ :button_click event,
2002
+ ?Integer? timeout
2003
+ ) {
2004
+ (Discorb::MessageComponentInteraction::Button interaction) -> boolish
2005
+ } -> Async::Task[Discorb::MessageComponentInteraction::Button]
2006
+ | (
2007
+ :select_menu_select event,
2008
+ ?Integer? timeout
2009
+ ) {
2010
+ (
2011
+ Discorb::MessageComponentInteraction::SelectMenu interaction
2012
+ ) -> boolish
2013
+ } -> Async::Task[Discorb::MessageComponentInteraction::SelectMenu]
2014
+ | (
2015
+ :form_submit event,
2016
+ ?Integer? timeout
2017
+ ) {
2018
+ (Discorb::ModalInteraction interaction) -> boolish
2019
+ } -> Async::Task[Discorb::ModalInteraction]
2020
+ | (
2021
+ :scheduled_event_create event,
2022
+ ?Integer? timeout
2023
+ ) {
2024
+ (Discorb::ScheduledEvent event) -> boolish
2025
+ } -> Async::Task[Discorb::ScheduledEvent]
2026
+ | (
2027
+ :scheduled_event_cancel event,
2028
+ ?Integer? timeout
2029
+ ) {
2030
+ (Discorb::ScheduledEvent event) -> boolish
2031
+ } -> Async::Task[Discorb::ScheduledEvent]
2032
+ | (
2033
+ :scheduled_event_edit event,
2034
+ ?Integer? timeout
2035
+ ) {
2036
+ (
2037
+ Discorb::ScheduledEvent before,
2038
+ Discorb::ScheduledEvent after
2039
+ ) -> boolish
2040
+ } -> Async::Task[[Discorb::ScheduledEvent, Discorb::ScheduledEvent]]
2041
+ | (
2042
+ :scheduled_event_start event,
2043
+ ?Integer? timeout
2044
+ ) {
2045
+ (Discorb::ScheduledEvent event) -> boolish
2046
+ } -> Async::Task[Discorb::ScheduledEvent]
2047
+ | (
2048
+ :scheduled_event_end event,
2049
+ ?Integer? timeout
2050
+ ) {
2051
+ (Discorb::ScheduledEvent event) -> boolish
2052
+ } -> Async::Task[Discorb::ScheduledEvent]
2053
+ | (
2054
+ :auto_moderation_rule_create event,
2055
+ ?Integer? timeout
2056
+ ) {
2057
+ (Discorb::AutoModRule rule) -> boolish
2058
+ } -> Async::Task[Discorb::AutoModRule]
2059
+ | (
2060
+ :auto_moderation_rule_update event,
2061
+ ?Integer? timeout
2062
+ ) {
2063
+ (Discorb::AutoModRule rule) -> boolish
2064
+ } -> Async::Task[Discorb::AutoModRule]
2065
+ | (
2066
+ :auto_moderation_rule_delete event,
2067
+ ?Integer? timeout
2068
+ ) {
2069
+ (Discorb::AutoModRule rule) -> boolish
2070
+ } -> Async::Task[Discorb::AutoModRule]
2071
+ | (
2072
+ :auto_moderation_action_execution event,
2073
+ ?Integer? timeout
2074
+ ) {
2075
+ (Discorb::Gateway::AutoModerationActionExecutionEvent event) -> boolish
2076
+ } -> Async::Task[Discorb::Gateway::AutoModerationActionExecutionEvent]
2077
+ | (
2078
+ :guild_create event,
2079
+ ?Integer? timeout
2080
+ ) {
2081
+ (Discorb::Guild guild) -> boolish
2082
+ } -> Async::Task[Discorb::Guild]
2083
+ | (
2084
+ :guild_delete event,
2085
+ ?Integer? timeout
2086
+ ) {
2087
+ (Discorb::Guild guild) -> boolish
2088
+ } -> Async::Task[Discorb::Guild]
2089
+ | (
2090
+ :thread_create event,
2091
+ ?Integer? timeout
2092
+ ) {
2093
+ (Discorb::ThreadChannel thread) -> boolish
2094
+ } -> Async::Task[Discorb::ThreadChannel]
2095
+ | (
2096
+ :scheduled_event_update event,
2097
+ ?Integer? timeout
2098
+ ) {
2099
+ (
2100
+ Discorb::ScheduledEvent before,
2101
+ Discorb::ScheduledEvent after
2102
+ ) -> boolish
2103
+ } -> Async::Task[[Discorb::ScheduledEvent, Discorb::ScheduledEvent]]
2104
+ | (
2105
+ :voice_channel_connect event,
2106
+ ?Integer? timeout
2107
+ ) {
2108
+ -> boolish
2109
+ } -> Async::Task[void]
2110
+ | (
2111
+ :voice_channel_disconnect event,
2112
+ ?Integer? timeout
2113
+ ) {
2114
+ -> boolish
2115
+ } -> Async::Task[void]
2116
+ | (
2117
+ :voice_channel_move event,
2118
+ ?Integer? timeout
2119
+ ) {
2120
+ -> boolish
2121
+ } -> Async::Task[void]
2122
+ | (
2123
+ :voice_channel_update event,
2124
+ ?Integer? timeout
2125
+ ) {
2126
+ -> boolish
2127
+ } -> Async::Task[void]
2128
+ | (
2129
+ :voice_mute_disable event,
2130
+ ?Integer? timeout
2131
+ ) {
2132
+ (Discorb::VoiceState state) -> boolish
2133
+ } -> Async::Task[Discorb::VoiceState]
2134
+ | (
2135
+ :voice_mute_enable event,
2136
+ ?Integer? timeout
2137
+ ) {
2138
+ (Discorb::VoiceState state) -> boolish
2139
+ } -> Async::Task[Discorb::VoiceState]
2140
+ | (
2141
+ :voice_mute_update event,
2142
+ ?Integer? timeout
2143
+ ) {
2144
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> boolish
2145
+ } -> Async::Task[[Discorb::VoiceState, Discorb::VoiceState]]
2146
+ | (
2147
+ :voice_server_mute_enable event,
2148
+ ?Integer? timeout
2149
+ ) {
2150
+ (Discorb::VoiceState state) -> boolish
2151
+ } -> Async::Task[Discorb::VoiceState]
2152
+ | (
2153
+ :voice_server_mute_disable event,
2154
+ ?Integer? timeout
2155
+ ) {
2156
+ (Discorb::VoiceState state) -> boolish
2157
+ } -> Async::Task[Discorb::VoiceState]
2158
+ | (
2159
+ :voice_server_mute_update event,
2160
+ ?Integer? timeout
2161
+ ) {
2162
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> boolish
2163
+ } -> Async::Task[[Discorb::VoiceState, Discorb::VoiceState]]
2164
+ | (
2165
+ :voice_self_mute_enable event,
2166
+ ?Integer? timeout
2167
+ ) {
2168
+ (Discorb::VoiceState state) -> boolish
2169
+ } -> Async::Task[Discorb::VoiceState]
2170
+ | (
2171
+ :voice_self_mute_disable event,
2172
+ ?Integer? timeout
2173
+ ) {
2174
+ (Discorb::VoiceState state) -> boolish
2175
+ } -> Async::Task[Discorb::VoiceState]
2176
+ | (
2177
+ :voice_self_mute_update event,
2178
+ ?Integer? timeout
2179
+ ) {
2180
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> boolish
2181
+ } -> Async::Task[[Discorb::VoiceState, Discorb::VoiceState]]
2182
+ | (
2183
+ :voice_deaf_enable event,
2184
+ ?Integer? timeout
2185
+ ) {
2186
+ (Discorb::VoiceState state) -> boolish
2187
+ } -> Async::Task[Discorb::VoiceState]
2188
+ | (
2189
+ :voice_deaf_disable event,
2190
+ ?Integer? timeout
2191
+ ) {
2192
+ (Discorb::VoiceState state) -> boolish
2193
+ } -> Async::Task[Discorb::VoiceState]
2194
+ | (
2195
+ :voice_deaf_update event,
2196
+ ?Integer? timeout
2197
+ ) {
2198
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> boolish
2199
+ } -> Async::Task[[Discorb::VoiceState, Discorb::VoiceState]]
2200
+ | (
2201
+ :voice_server_deaf_enable event,
2202
+ ?Integer? timeout
2203
+ ) {
2204
+ (Discorb::VoiceState state) -> boolish
2205
+ } -> Async::Task[Discorb::VoiceState]
2206
+ | (
2207
+ :voice_server_deaf_disable event,
2208
+ ?Integer? timeout
2209
+ ) {
2210
+ (Discorb::VoiceState state) -> boolish
2211
+ } -> Async::Task[Discorb::VoiceState]
2212
+ | (
2213
+ :voice_server_deaf_update event,
2214
+ ?Integer? timeout
2215
+ ) {
2216
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> boolish
2217
+ } -> Async::Task[[Discorb::VoiceState, Discorb::VoiceState]]
2218
+ | (
2219
+ :voice_self_deaf_enable event,
2220
+ ?Integer? timeout
2221
+ ) {
2222
+ (Discorb::VoiceState state) -> boolish
2223
+ } -> Async::Task[Discorb::VoiceState]
2224
+ | (
2225
+ :voice_self_deaf_disable event,
2226
+ ?Integer? timeout
2227
+ ) {
2228
+ (Discorb::VoiceState state) -> boolish
2229
+ } -> Async::Task[Discorb::VoiceState]
2230
+ | (
2231
+ :voice_self_deaf_update event,
2232
+ ?Integer? timeout
2233
+ ) {
2234
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> boolish
2235
+ } -> Async::Task[[Discorb::VoiceState, Discorb::VoiceState]]
2236
+ | (
2237
+ :voice_stream_start event,
2238
+ ?Integer? timeout
2239
+ ) {
2240
+ (Discorb::VoiceState state) -> boolish
2241
+ } -> Async::Task[Discorb::VoiceState]
2242
+ | (
2243
+ :voice_stream_end event,
2244
+ ?Integer? timeout
2245
+ ) {
2246
+ (Discorb::VoiceState state) -> boolish
2247
+ } -> Async::Task[Discorb::VoiceState]
2248
+ | (
2249
+ :voice_stream_update event,
2250
+ ?Integer? timeout
2251
+ ) {
2252
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> boolish
2253
+ } -> Async::Task[[Discorb::VoiceState, Discorb::VoiceState]]
2254
+ | (
2255
+ :voice_video_start event,
2256
+ ?Integer? timeout
2257
+ ) {
2258
+ (Discorb::VoiceState state) -> boolish
2259
+ } -> Async::Task[Discorb::VoiceState]
2260
+ | (
2261
+ :voice_video_end event,
2262
+ ?Integer? timeout
2263
+ ) {
2264
+ (Discorb::VoiceState state) -> boolish
2265
+ } -> Async::Task[Discorb::VoiceState]
2266
+ | (
2267
+ :voice_video_update event,
2268
+ ?Integer? timeout
2269
+ ) {
2270
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> boolish
2271
+ } -> Async::Task[[Discorb::VoiceState, Discorb::VoiceState]]
2272
+ | (
2273
+ :stage_instance_create event,
2274
+ ?Integer? timeout
2275
+ ) {
2276
+ (Discorb::StageInstance `instance`) -> boolish
2277
+ } -> Async::Task[Discorb::StageInstance]
2278
+ | (
2279
+ :stage_instance_delete event,
2280
+ ?Integer? timeout
2281
+ ) {
2282
+ (Discorb::StageInstance `instance`) -> boolish
2283
+ } -> Async::Task[Discorb::StageInstance]
2284
+ | (
2285
+ :stage_instance_update event,
2286
+ ?Integer? timeout
2287
+ ) {
2288
+ (Discorb::StageInstance before, Discorb::StageInstance after) -> boolish
2289
+ } -> Async::Task[[Discorb::StageInstance, Discorb::StageInstance]]
2290
+ | (
2291
+ :voice_state_update event,
2292
+ ?Integer? timeout
2293
+ ) {
2294
+ (Discorb::VoiceState before, Discorb::VoiceState after) -> boolish
2295
+ } -> Async::Task[[Discorb::VoiceState, Discorb::VoiceState]]
2296
+ | (
2297
+ Symbol event,
2298
+ ?Integer? timeout
2299
+ ) {
2300
+ (*untyped) -> boolish
2301
+ } -> Async::Task[untyped]
2302
+
2303
+ def inspect: -> String
2304
+
2305
+ #
2306
+ # Load the extension.
2307
+ #
2308
+ # @param [Class, Discorb::Extension] ext The extension to load.
2309
+ # @param [Object] ... The arguments to pass to the `ext#initialize`.
2310
+ def load_extension: (Class | Discorb::Extension ext) -> Discorb::Extension
2311
+
2312
+ #
2313
+ # Starts the client.
2314
+ # @note This method behavior will change by CLI.
2315
+ # @see file:docs/cli.md CLI documentation
2316
+ #
2317
+ # @param [String, nil] token The token to use.
2318
+ #
2319
+ # @note If the token is nil, you should use `discorb run` with the `-e` or `--env` option.
2320
+ def run: (?String? token, ?shards: untyped, ?shard_count: untyped) -> void
2321
+
2322
+ #
2323
+ # Stops the client.
2324
+ def close!: -> void
2325
+
2326
+ private
2327
+
2328
+ def before_run: (untyped token) -> untyped
2329
+
2330
+ def run_setup: (untyped token) -> untyped
2331
+
2332
+ def set_status: (untyped status, untyped shard) -> untyped
2333
+
2334
+ def connection: -> untyped
2335
+
2336
+ def connection=: (untyped value) -> untyped
2337
+
2338
+ def start_client: (
2339
+ untyped token,
2340
+ ?shards: untyped,
2341
+ ?shard_count: untyped
2342
+ ) -> untyped
2343
+
2344
+ def main_loop: (untyped shard) -> untyped
2345
+
2346
+ def main_task: -> untyped
2347
+
2348
+ def main_task=: (untyped value) -> untyped
2349
+
2350
+ def set_default_events: -> untyped
2351
+
2352
+ public
2353
+
2354
+ #
2355
+ # Setup commands.
2356
+ # @async
2357
+ # @see Client#initialize
2358
+ #
2359
+ # @param [String] token Bot token.
2360
+ # @param [Array<#to_s>, false, nil] guild_ids
2361
+ # Guild IDs to use as default. If `false` is given, it will be global command.
2362
+ #
2363
+ # @note `token` parameter only required if you don't run client.
2364
+ def setup_commands: (
2365
+ ?String? token,
2366
+ ?guild_ids: (::Array[_ToS] | false)?
2367
+ ) -> void
2368
+
2369
+ #
2370
+ # Claer commands in specified guilds.
2371
+ # @async
2372
+ # @see Client#initialize
2373
+ #
2374
+ # @param [String] token Bot token.
2375
+ # @param [Array<#to_s>, false, nil] guild_ids Guild IDs to clear.
2376
+ #
2377
+ # @note `token` parameter only required if you don't run client.
2378
+ def clear_commands: (
2379
+ String token,
2380
+ (::Array[_ToS] | false)? guild_ids
2381
+ ) -> void
2382
+
2383
+ private
2384
+
2385
+ def connect_gateway: (untyped reconnect) -> untyped
2386
+
2387
+ def send_gateway: (untyped opcode, **untyped value) -> untyped
2388
+
2389
+ def handle_gateway: (untyped payload, untyped reconnect) -> untyped
2390
+
2391
+ def handle_heartbeat: -> untyped
2392
+
2393
+ def handle_event: (untyped event_name, untyped data) -> untyped
2394
+
2395
+ def ready: -> untyped
2396
+
2397
+ public
2398
+
2399
+ # @return [Discorb::Intents] The intents that the client is currently using.
2400
+ attr_accessor intents: Discorb::Intents
2401
+
2402
+ # @return [Discorb::Application] The application that the client is using.
2403
+ # @return [nil] If never fetched application by {#fetch_application}.
2404
+ attr_reader application: Discorb::Application?
2405
+
2406
+ # @return [Discorb::HTTP] The http client.
2407
+ attr_reader http: Discorb::HTTP
2408
+
2409
+ # @return [Integer] The heartbeat interval.
2410
+ attr_reader heartbeat_interval: Integer
2411
+
2412
+ # @return [Integer] The API version of the Discord gateway.
2413
+ # @return [nil] If not connected to the gateway.
2414
+ attr_reader api_version: Integer?
2415
+
2416
+ # @return [String] The token of the client.
2417
+ attr_reader token: String
2418
+
2419
+ # @return [Discorb::AllowedMentions] The allowed mentions that the client is using.
2420
+ attr_reader allowed_mentions: Discorb::AllowedMentions
2421
+
2422
+ # @return [Discorb::ClientUser] The client user.
2423
+ attr_reader user: Discorb::ClientUser?
2424
+
2425
+ # @return [Discorb::Dictionary{Discorb::Snowflake => Discorb::Guild}] A dictionary of guilds.
2426
+ attr_reader guilds: Discorb::Dictionary[Discorb::Snowflake, Discorb::Guild]
2427
+
2428
+ # @return [Discorb::Dictionary{Discorb::Snowflake => Discorb::User}] A dictionary of users.
2429
+ attr_reader users: Discorb::Dictionary[Discorb::Snowflake, Discorb::User]
2430
+
2431
+ # @return [Discorb::Dictionary{Discorb::Snowflake => Discorb::Channel}] A dictionary of channels.
2432
+ attr_reader channels: Discorb::Dictionary[Discorb::Snowflake, Discorb::Channel]
2433
+
2434
+ # @return [Discorb::Dictionary{Discorb::Snowflake => Discorb::Emoji}] A dictionary of emojis.
2435
+ attr_reader emojis: Discorb::Dictionary[Discorb::Snowflake, Discorb::Emoji]
2436
+
2437
+ # @return [Discorb::Dictionary{Discorb::Snowflake => Discorb::Message}] A dictionary of messages.
2438
+ attr_reader messages: Discorb::Dictionary[Discorb::Snowflake, Discorb::Message]
2439
+
2440
+ # @return [Array<Discorb::ApplicationCommand::Command>] The commands that the client is using.
2441
+ attr_reader commands: ::Array[Discorb::ApplicationCommand::Command]
2442
+
2443
+ # @return [Float] The ping of the client.
2444
+ # @note This will be calculated from heartbeat and heartbeat_ack.
2445
+ # @return [nil] If not connected to the gateway.
2446
+ attr_reader ping: Float?
2447
+
2448
+ # @return [:initialized, :running, :closed] The status of the client.
2449
+ attr_reader status: Symbol
2450
+
2451
+ # @return [Hash{String => Discorb::Extension}] The loaded extensions.
2452
+ attr_reader extensions: ::Hash[String, Discorb::Extension]
2453
+
2454
+ # @return [Hash{Integer => Discorb::Shard}] The shards of the client.
2455
+ attr_reader shards: ::Hash[Integer, Discorb::Shard]
2456
+
2457
+ # @private
2458
+ # @return [Hash{Discorb::Snowflake => Discorb::ApplicationCommand::Command}] The commands on the top level.
2459
+ attr_reader callable_commands: ::Array[Discorb::ApplicationCommand::Command]
2460
+
2461
+ # @private
2462
+ # @return [{String => Thread::Mutex}] A hash of mutexes.
2463
+ attr_reader mutex: ::Hash[String, Thread::Mutex]
2464
+
2465
+ # @return [String] The session ID of the client or current shard.
2466
+ # @return [nil] If not connected to the gateway.
2467
+ attr_accessor session_id: String?
2468
+
2469
+ # @return [Discorb::Shard] The current shard. This is implemented with Thread variables.
2470
+ # @return [nil] If client has no shard.
2471
+ attr_reader shard: Discorb::Shard?
2472
+
2473
+ # @return [Integer] The current shard ID. This is implemented with Thread variables.
2474
+ # @return [nil] If client has no shard.
2475
+ attr_reader shard_id: Integer?
2476
+
2477
+ # @return [Logger] The logger.
2478
+ attr_reader logger: Logger
2479
+ end
2480
+
2481
+ #
2482
+ # Represents a client user.
2483
+ class ClientUser < Discorb::User
2484
+ #
2485
+ # Edit the client user.
2486
+ # @async
2487
+ # @macro edit
2488
+ #
2489
+ # @param [String] name The new username.
2490
+ # @param [Discorb::Image] avatar The new avatar.
2491
+ #
2492
+ # @return [Async::Task<void>] The task.
2493
+ def edit: (?name: String, ?avatar: Discorb::Image) -> Async::Task[void]
2494
+ end
2495
+ end