discorb 0.15.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) 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 +1 -1
  8. data/.github/workflows/spec.yml +30 -0
  9. data/.lefthook/commit-msg/validator.rb +5 -0
  10. data/.rspec +2 -0
  11. data/.rspec_parallel +2 -0
  12. data/.rubocop.yml +49 -8
  13. data/Changelog.md +32 -1
  14. data/Gemfile +14 -8
  15. data/Rakefile +46 -25
  16. data/bin/console +3 -3
  17. data/docs/Examples.md +1 -1
  18. data/docs/application_command.md +138 -46
  19. data/docs/cli/irb.md +2 -2
  20. data/docs/cli/new.md +14 -9
  21. data/docs/cli/run.md +7 -11
  22. data/docs/cli.md +17 -10
  23. data/docs/events.md +257 -193
  24. data/docs/extension.md +1 -2
  25. data/docs/faq.md +0 -1
  26. data/docs/tutorial.md +12 -12
  27. data/docs/voice_events.md +106 -106
  28. data/examples/commands/message.rb +63 -0
  29. data/examples/commands/permission.rb +18 -0
  30. data/examples/commands/slash.rb +44 -0
  31. data/examples/commands/user.rb +51 -0
  32. data/examples/components/authorization_button.rb +2 -2
  33. data/examples/components/select_menu.rb +2 -2
  34. data/examples/extension/main.rb +1 -1
  35. data/examples/extension/message_expander.rb +5 -2
  36. data/examples/simple/eval.rb +2 -2
  37. data/examples/simple/ping_pong.rb +1 -1
  38. data/examples/simple/rolepanel.rb +2 -2
  39. data/examples/simple/shard.rb +17 -0
  40. data/examples/simple/wait_for_message.rb +1 -1
  41. data/exe/discorb +31 -16
  42. data/lefthook.yml +45 -0
  43. data/lib/discorb/allowed_mentions.rb +8 -0
  44. data/lib/discorb/app_command/command.rb +184 -60
  45. data/lib/discorb/app_command/common.rb +25 -0
  46. data/lib/discorb/app_command/handler.rb +116 -34
  47. data/lib/discorb/app_command.rb +2 -1
  48. data/lib/discorb/application.rb +17 -7
  49. data/lib/discorb/asset.rb +10 -2
  50. data/lib/discorb/attachment.rb +17 -2
  51. data/lib/discorb/audit_logs.rb +53 -12
  52. data/lib/discorb/channel/base.rb +108 -0
  53. data/lib/discorb/channel/category.rb +32 -0
  54. data/lib/discorb/channel/container.rb +44 -0
  55. data/lib/discorb/channel/dm.rb +28 -0
  56. data/lib/discorb/channel/guild.rb +245 -0
  57. data/lib/discorb/channel/stage.rb +140 -0
  58. data/lib/discorb/channel/text.rb +345 -0
  59. data/lib/discorb/channel/thread.rb +321 -0
  60. data/lib/discorb/channel/voice.rb +79 -0
  61. data/lib/discorb/channel.rb +2 -1126
  62. data/lib/discorb/client.rb +160 -64
  63. data/lib/discorb/common.rb +18 -3
  64. data/lib/discorb/components/button.rb +7 -7
  65. data/lib/discorb/components/select_menu.rb +6 -18
  66. data/lib/discorb/components/text_input.rb +12 -2
  67. data/lib/discorb/components.rb +1 -1
  68. data/lib/discorb/dictionary.rb +2 -0
  69. data/lib/discorb/embed.rb +55 -14
  70. data/lib/discorb/emoji.rb +59 -5
  71. data/lib/discorb/emoji_table.rb +4970 -4
  72. data/lib/discorb/error.rb +7 -1
  73. data/lib/discorb/event.rb +56 -21
  74. data/lib/discorb/exe/about.rb +1 -0
  75. data/lib/discorb/exe/irb.rb +2 -4
  76. data/lib/discorb/exe/new.rb +95 -28
  77. data/lib/discorb/exe/run.rb +9 -37
  78. data/lib/discorb/exe/setup.rb +25 -12
  79. data/lib/discorb/exe/show.rb +4 -3
  80. data/lib/discorb/extend.rb +1 -0
  81. data/lib/discorb/extension.rb +6 -3
  82. data/lib/discorb/flag.rb +11 -0
  83. data/lib/discorb/gateway.rb +312 -169
  84. data/lib/discorb/gateway_requests.rb +4 -7
  85. data/lib/discorb/guild.rb +255 -89
  86. data/lib/discorb/guild_template.rb +34 -7
  87. data/lib/discorb/http.rb +23 -11
  88. data/lib/discorb/integration.rb +27 -9
  89. data/lib/discorb/intents.rb +8 -8
  90. data/lib/discorb/interaction/autocomplete.rb +31 -19
  91. data/lib/discorb/interaction/command.rb +70 -17
  92. data/lib/discorb/interaction/components.rb +20 -4
  93. data/lib/discorb/interaction/modal.rb +0 -1
  94. data/lib/discorb/interaction/response.rb +73 -22
  95. data/lib/discorb/interaction/root.rb +29 -14
  96. data/lib/discorb/interaction.rb +1 -0
  97. data/lib/discorb/invite.rb +16 -9
  98. data/lib/discorb/member.rb +46 -5
  99. data/lib/discorb/message.rb +56 -15
  100. data/lib/discorb/message_meta.rb +39 -9
  101. data/lib/discorb/modules.rb +56 -14
  102. data/lib/discorb/permission.rb +14 -5
  103. data/lib/discorb/presence.rb +43 -10
  104. data/lib/discorb/rate_limit.rb +13 -3
  105. data/lib/discorb/reaction.rb +10 -4
  106. data/lib/discorb/role.rb +31 -4
  107. data/lib/discorb/shard.rb +74 -0
  108. data/lib/discorb/sticker.rb +30 -21
  109. data/lib/discorb/user.rb +13 -1
  110. data/lib/discorb/utils/colored_puts.rb +1 -0
  111. data/lib/discorb/voice_state.rb +30 -8
  112. data/lib/discorb/webhook.rb +88 -25
  113. data/lib/discorb.rb +10 -6
  114. data/po/yard.pot +9 -9
  115. data/sig/discorb.rbs +7232 -5837
  116. metadata +23 -6
  117. data/examples/commands/bookmarker.rb +0 -42
  118. data/examples/commands/hello.rb +0 -10
  119. data/examples/commands/inspect.rb +0 -25
  120. data/lib/discorb/log.rb +0 -81
data/docs/events.md CHANGED
@@ -30,13 +30,13 @@ class << client
30
30
  end
31
31
  ```
32
32
 
33
- If you want to seperate event handlers from the client, consider using {Discorb::Extension}. {file:docs/extension.md Learn more about extensions}.
33
+ If you want to separate event handlers from the client, consider using {Discorb::Extension}. {file:docs/extension.md Learn more about extensions}.
34
34
 
35
- Since v0.6.1, you can set `:override` to `true` to register overridable event handlers.
35
+ Since v0.6.1, you can set `:override` to `true` to register event handlers that can be overridden.
36
36
 
37
37
  ```ruby
38
38
  client.on :message, override: true do |event|
39
- puts "This event handler is overrideable!"
39
+ puts "This event handler can be overridden."
40
40
  end
41
41
 
42
42
  client.on :message do |event|
@@ -44,8 +44,8 @@ client.on :message do |event|
44
44
  end
45
45
  ```
46
46
 
47
- This example will print `Override!`, but not `This event handler is overrideable!`.
48
- This is useful for registering event handlers as default behaviour, such as error handlers.
47
+ This example will print `Override!`, but not `This event handler can be overridden.`.
48
+ This is useful for registering event handlers as default behavior, such as error handlers.
49
49
 
50
50
  ```ruby
51
51
  # In the library...
@@ -66,12 +66,13 @@ end
66
66
  ### Client events
67
67
 
68
68
  #### `event_receive(event_name, data)`
69
- Fires when an event is received.
70
69
 
71
- | Parameter | Type | Description |
72
- | ---------- | ----- | ----------- |
73
- |`event_name`| Symbol | The name of the event. |
74
- |`data` | Hash | The data of the event. |
70
+ Fires when an event is received.
71
+
72
+ | Parameter | Type | Description |
73
+ | ------------ | ------ | ---------------------- |
74
+ | `event_name` | Symbol | The name of the event. |
75
+ | `data` | Hash | The data of the event. |
75
76
 
76
77
  #### `ready()`
77
78
 
@@ -95,75 +96,90 @@ Defaults to printing the error to stderr, override to handle it yourself.
95
96
  Fires when `discorb setup` is run.
96
97
  This is useful for setting up some dependencies, such as the database.
97
98
 
99
+ #### `shard_standby(shard)`
100
+
101
+ Fires when a shard is standby.
102
+
103
+ | Parameter | Type | Description |
104
+ | --------- | ---------------- | -------------------------- |
105
+ | `shard` | {Discorb::Shard} | The shard that is standby. |
106
+
107
+ #### `shard_resumed(shard)`
108
+
109
+ Fires when a shard is resumed connection.
110
+
111
+ | Parameter | Type | Description |
112
+ | --------- | ---------------- | -------------------------- |
113
+ | `shard` | {Discorb::Shard} | The shard that is standby. |
114
+
98
115
  ### Guild events
99
116
 
100
117
  #### `guild_join(guild)`
101
118
 
102
119
  Fires when client joins a guild.
103
120
 
104
- | Parameter | Type | Description |
105
- | ---------- | ----- | ----------- |
106
- |`guild` | {Discorb::Guild} | The guild that was joined. |
121
+ | Parameter | Type | Description |
122
+ | --------- | ---------------- | -------------------------- |
123
+ | `guild` | {Discorb::Guild} | The guild that was joined. |
107
124
 
108
125
  #### `guild_available(guild)`
109
126
 
110
127
  Fires when a guild becomes available.
111
128
 
112
- | Parameter | Type | Description |
113
- | ---------- | ----- | ----------- |
114
- |`guild` | {Discorb::Guild} | The guild that became available. |
129
+ | Parameter | Type | Description |
130
+ | --------- | ---------------- | -------------------------------- |
131
+ | `guild` | {Discorb::Guild} | The guild that became available. |
115
132
 
116
133
  #### `guild_update(before, after)`
117
134
 
118
135
  Fires when client updates a guild.
119
136
 
120
- | Parameter | Type | Description |
121
- | ---------- | ----- | ----------- |
122
- |`before` | {Discorb::Guild} | The guild before the update. |
123
- |`after` | {Discorb::Guild} | The guild after the update. |
137
+ | Parameter | Type | Description |
138
+ | --------- | ---------------- | ---------------------------- |
139
+ | `before` | {Discorb::Guild} | The guild before the update. |
140
+ | `after` | {Discorb::Guild} | The guild after the update. |
124
141
 
125
142
  #### `guild_leave(guild)`
126
143
 
127
144
  Fires when client leaves a guild.
128
145
 
129
- | Parameter | Type | Description |
130
- | ---------- | ----- | ----------- |
131
- |`guild` | {Discorb::Guild} | The guild that was left. |
146
+ | Parameter | Type | Description |
147
+ | --------- | ---------------- | ------------------------ |
148
+ | `guild` | {Discorb::Guild} | The guild that was left. |
132
149
 
133
150
  #### `guild_destroy(guild)`
134
151
 
135
152
  Fires when guild is destroyed.
136
153
 
137
- | Parameter | Type | Description |
138
- | ---------- | ----- | ----------- |
139
- |`guild` | {Discorb::Guild} | The guild that was destroyed. |
154
+ | Parameter | Type | Description |
155
+ | --------- | ---------------- | ----------------------------- |
156
+ | `guild` | {Discorb::Guild} | The guild that was destroyed. |
140
157
 
141
158
  #### `guild_integrations_update(guild)`
142
159
 
143
160
  Fires when guild integrations are updated.
144
161
 
145
- | Parameter | Type | Description |
146
- | ---------- | ----- | ----------- |
147
- |`guild` | {Discorb::Guild} | The guild that integrations were updated for. |
162
+ | Parameter | Type | Description |
163
+ | --------- | ---------------- | --------------------------------------------- |
164
+ | `guild` | {Discorb::Guild} | The guild that integrations were updated for. |
148
165
 
149
166
  #### `guild_ban_add(guild, user)`
150
167
 
151
168
  Fires when a user is banned from a guild.
152
169
 
153
-
154
- | Parameter | Type | Description |
155
- | ---------- | ----- | ----------- |
156
- |`guild` | {Discorb::Guild} | The guild that the user was banned from. |
157
- |`user` | {Discorb::User} | The user that was banned. |
170
+ | Parameter | Type | Description |
171
+ | --------- | ---------------- | ---------------------------------------- |
172
+ | `guild` | {Discorb::Guild} | The guild that the user was banned from. |
173
+ | `user` | {Discorb::User} | The user that was banned. |
158
174
 
159
175
  #### `guild_ban_remove(guild, user)`
160
176
 
161
177
  Fires when a user is unbanned from a guild.
162
178
 
163
- | Parameter | Type | Description |
164
- | ---------- | ----- | ----------- |
165
- |`guild` | {Discorb::Guild} | The guild that the user was unbanned from. |
166
- |`user` | {Discorb::User} | The user that was unbanned. |
179
+ | Parameter | Type | Description |
180
+ | --------- | ---------------- | ------------------------------------------ |
181
+ | `guild` | {Discorb::Guild} | The guild that the user was unbanned from. |
182
+ | `user` | {Discorb::User} | The user that was unbanned. |
167
183
 
168
184
  ### Channel events
169
185
 
@@ -171,88 +187,87 @@ Fires when a user is unbanned from a guild.
171
187
 
172
188
  Fires when a channel is created.
173
189
 
174
- | Parameter | Type | Description |
175
- | ---------- | ----- | ----------- |
176
- |`channel` | {Discorb::Channel} | The channel that was created. |
190
+ | Parameter | Type | Description |
191
+ | --------- | ------------------ | ----------------------------- |
192
+ | `channel` | {Discorb::Channel} | The channel that was created. |
177
193
 
178
194
  #### `channel_update(before, after)`
179
195
 
180
196
  Fires when a channel is updated.
181
197
 
182
- | Parameter | Type | Description |
183
- | ---------- | ----- | ----------- |
184
- |`before` | {Discorb::Channel} | The channel before the update. |
185
- |`after` | {Discorb::Channel} | The channel after the update. |
198
+ | Parameter | Type | Description |
199
+ | --------- | ------------------ | ------------------------------ |
200
+ | `before` | {Discorb::Channel} | The channel before the update. |
201
+ | `after` | {Discorb::Channel} | The channel after the update. |
186
202
 
187
203
  #### `channel_delete(channel)`
188
204
 
189
205
  Fires when a channel is deleted.
190
206
 
191
- | Parameter | Type | Description |
192
- | ---------- | ----- | ----------- |
193
- |`channel` | {Discorb::Channel} | The channel that was deleted. |
207
+ | Parameter | Type | Description |
208
+ | --------- | ------------------ | ----------------------------- |
209
+ | `channel` | {Discorb::Channel} | The channel that was deleted. |
194
210
 
195
211
  #### `webhooks_update(event)`
196
212
 
197
213
  Fires when a webhook is updated.
198
214
 
199
- | Parameter | Type | Description |
200
- | ---------- | ----- | ----------- |
201
- |`event` | {Discorb::Gateway::WebhooksUpdateEvent} | The webhook update event. |
215
+ | Parameter | Type | Description |
216
+ | --------- | --------------------------------------- | ------------------------- |
217
+ | `event` | {Discorb::Gateway::WebhooksUpdateEvent} | The webhook update event. |
202
218
 
203
219
  #### `thread_new(thread)`
204
220
 
205
221
  Fires when a thread is created.
206
222
 
207
- | Parameter | Type | Description |
208
- | ---------- | ----- | ----------- |
209
- |`thread` | {Discorb::ThreadChannel} | The thread that was created. |
223
+ | Parameter | Type | Description |
224
+ | --------- | ------------------------ | ---------------------------- |
225
+ | `thread` | {Discorb::ThreadChannel} | The thread that was created. |
210
226
 
211
227
  #### `thread_join(thread)`
212
228
 
213
229
  Fires when client joins a thread.
214
230
 
215
- | Parameter | Type | Description |
216
- | ---------- | ----- | ----------- |
217
- |`thread` | {Discorb::ThreadChannel} | The thread that was joined. |
218
-
231
+ | Parameter | Type | Description |
232
+ | --------- | ------------------------ | --------------------------- |
233
+ | `thread` | {Discorb::ThreadChannel} | The thread that was joined. |
219
234
 
220
235
  #### `thread_delete(thread)`
221
236
 
222
237
  Fires when a thread is deleted.
223
238
 
224
- | Parameter | Type | Description |
225
- | ---------- | ----- | ----------- |
226
- |`thread` | {Discorb::ThreadChannel} | The thread that was deleted. |
239
+ | Parameter | Type | Description |
240
+ | --------- | ------------------------ | ---------------------------- |
241
+ | `thread` | {Discorb::ThreadChannel} | The thread that was deleted. |
227
242
 
228
243
  #### `thread_update(before, after)`
229
244
 
230
245
  Fires when a thread is updated.
231
246
 
232
- | Parameter | Type | Description |
233
- | ---------- | ----- | ----------- |
234
- |`before` | {Discorb::ThreadChannel} | The thread before the update. |
235
- |`after` | {Discorb::ThreadChannel} | The thread after the update. |
247
+ | Parameter | Type | Description |
248
+ | --------- | ------------------------ | ----------------------------- |
249
+ | `before` | {Discorb::ThreadChannel} | The thread before the update. |
250
+ | `after` | {Discorb::ThreadChannel} | The thread after the update. |
236
251
 
237
252
  #### `thread_members_update(thread, added, removed)`
238
253
 
239
254
  Fires when a thread's members are updated.
240
255
 
241
- | Parameter | Type | Description |
242
- | ---------- | ----- | ----------- |
243
- |`thread` | {Discorb::ThreadChannel} | The thread that the members were updated for. |
244
- |`added` | Array<{Discorb::ThreadChannel::Member}> | An array of {Discorb::ThreadChannel::Member} objects that were added to the thread. |
245
- |`removed` | Array<{Discorb::ThreadChannel::Member}> | An array of {Discorb::ThreadChannel::Member} objects that were removed from the thread. |
256
+ | Parameter | Type | Description |
257
+ | --------- | --------------------------------------- | --------------------------------------------------------------------------------------- |
258
+ | `thread` | {Discorb::ThreadChannel} | The thread that the members were updated for. |
259
+ | `added` | Array<{Discorb::ThreadChannel::Member}> | An array of {Discorb::ThreadChannel::Member} objects that were added to the thread. |
260
+ | `removed` | Array<{Discorb::ThreadChannel::Member}> | An array of {Discorb::ThreadChannel::Member} objects that were removed from the thread. |
246
261
 
247
262
  #### `thread_member_update(before, after)`
248
263
 
249
264
  Fires when a thread member is updated.
250
265
 
251
- | Parameter | Type | Description |
252
- | --------- | ----- | ----------- |
253
- |`thread` | {Discorb::ThreadChannel} | The thread that the member was updated for. |
254
- |`before` | {Discorb::ThreadChannel::Member} | The thread member before the update. |
255
- |`after` | {Discorb::ThreadChannel::Member} | The thread member after the update. |
266
+ | Parameter | Type | Description |
267
+ | --------- | -------------------------------- | ------------------------------------------- |
268
+ | `thread` | {Discorb::ThreadChannel} | The thread that the member was updated for. |
269
+ | `before` | {Discorb::ThreadChannel::Member} | The thread member before the update. |
270
+ | `after` | {Discorb::ThreadChannel::Member} | The thread member after the update. |
256
271
 
257
272
  ### Integration events
258
273
 
@@ -260,26 +275,25 @@ Fires when a thread member is updated.
260
275
 
261
276
  Fires when a guild integration is created.
262
277
 
263
- | Parameter | Type | Description |
264
- | ---------- | ----- | ----------- |
265
- |`integration`| {Discorb::Integration}| The created integration. |
278
+ | Parameter | Type | Description |
279
+ | ------------- | ---------------------- | ------------------------ |
280
+ | `integration` | {Discorb::Integration} | The created integration. |
266
281
 
267
282
  #### `integration_update(after)`
268
283
 
269
284
  Fires when a guild integration is updated.
270
285
 
271
-
272
- | Parameter | Type | Description |
273
- | ---------- | ----- | ----------- |
274
- |`after` | {Discorb::Integration}| The integration after the update. |
286
+ | Parameter | Type | Description |
287
+ | --------- | ---------------------- | --------------------------------- |
288
+ | `after` | {Discorb::Integration} | The integration after the update. |
275
289
 
276
290
  #### `integration_delete(integration)`
277
291
 
278
292
  Fires when a guild integration is deleted.
279
293
 
280
- | Parameter | Type | Description |
281
- | ---------- | ----- | ----------- |
282
- |`integration`| {Discorb::Integration}| The deleted integration. |
294
+ | Parameter | Type | Description |
295
+ | ------------- | ---------------------- | ------------------------ |
296
+ | `integration` | {Discorb::Integration} | The deleted integration. |
283
297
 
284
298
  ### Message events
285
299
 
@@ -287,27 +301,27 @@ Fires when a guild integration is deleted.
287
301
 
288
302
  Fires when a message is created.
289
303
 
290
- | Parameter | Type | Description |
291
- | ---------- | ----- | ----------- |
292
- |`message` | {Discorb::Message}| The created message. |
304
+ | Parameter | Type | Description |
305
+ | --------- | ------------------ | -------------------- |
306
+ | `message` | {Discorb::Message} | The created message. |
293
307
 
294
308
  #### `message_update(event)`
295
309
 
296
310
  Fires when a message is updated.
297
311
 
298
- | Parameter | Type | Description |
299
- | ---------- | ----- | ----------- |
300
- |`event` | {Discorb::Gateway::MessageUpdateEvent}| The message after the update. |
312
+ | Parameter | Type | Description |
313
+ | --------- | -------------------------------------- | ----------------------------- |
314
+ | `event` | {Discorb::Gateway::MessageUpdateEvent} | The message after the update. |
301
315
 
302
316
  #### `message_delete(message, channel, guild)`
303
317
 
304
318
  Fires when a message is deleted.
305
319
 
306
- | Parameter | Type | Description |
307
- | ---------- | ----- | ----------- |
308
- |`message` | {Discorb::Message}| The deleted message. |
309
- |`channel` | {Discorb::Channel}| The channel the message was deleted from. |
310
- |`guild` | ?{Discorb::Guild} | The guild the message was deleted from. |
320
+ | Parameter | Type | Description |
321
+ | --------- | ------------------ | ----------------------------------------- |
322
+ | `message` | {Discorb::Message} | The deleted message. |
323
+ | `channel` | {Discorb::Channel} | The channel the message was deleted from. |
324
+ | `guild` | ?{Discorb::Guild} | The guild the message was deleted from. |
311
325
 
312
326
  ##### Note
313
327
 
@@ -318,35 +332,35 @@ This will fire when cached messages are deleted.
318
332
  Fires when a message is deleted.
319
333
  Not like {file:#message_delete} this will fire even message is not cached.
320
334
 
321
- | Parameter | Type | Description |
322
- | ---------- | ----- | ----------- |
323
- |`message_id`| {Discorb::Snowflake} | The deleted message ID. |
324
- |`channel` | {Discorb::Channel}| The channel the message was deleted from. |
325
- |`guild` | ?{Discorb::Guild} | The guild the message was deleted from. |
335
+ | Parameter | Type | Description |
336
+ | ------------ | -------------------- | ----------------------------------------- |
337
+ | `message_id` | {Discorb::Snowflake} | The deleted message ID. |
338
+ | `channel` | {Discorb::Channel} | The channel the message was deleted from. |
339
+ | `guild` | ?{Discorb::Guild} | The guild the message was deleted from. |
326
340
 
327
341
  #### `message_delete_bulk(messages)`
328
342
 
329
343
  Fires when a bulk of messages are deleted.
330
344
 
331
- | Parameter | Type | Description |
332
- | ---------- | ----- | ----------- |
333
- |`messages` | Array<{Discorb::Message}, {Discorb::Gateway::UnknownDeleteBulkMessage}> | The deleted messages. |
345
+ | Parameter | Type | Description |
346
+ | ---------- | ----------------------------------------------------------------------- | --------------------- |
347
+ | `messages` | Array<{Discorb::Message}, {Discorb::Gateway::UnknownDeleteBulkMessage}> | The deleted messages. |
334
348
 
335
349
  #### `message_pin_update(event)`
336
350
 
337
351
  Fires when a message is pinned or unpinned.
338
352
 
339
- | Parameter | Type | Description |
340
- | ---------- | ----- | ----------- |
341
- |`event` | {Discorb::Gateway::MessagePinEvent}| The event object. |
353
+ | Parameter | Type | Description |
354
+ | --------- | ----------------------------------- | ----------------- |
355
+ | `event` | {Discorb::Gateway::MessagePinEvent} | The event object. |
342
356
 
343
357
  #### `typing_start(event)`
344
358
 
345
359
  Fires when a user starts typing.
346
360
 
347
- | Parameter | Type | Description |
348
- | --------- | ----- | ----------- |
349
- |`event` | {Discorb::Gateway::TypingStartEvent}| The event object. |
361
+ | Parameter | Type | Description |
362
+ | --------- | ------------------------------------ | ----------------- |
363
+ | `event` | {Discorb::Gateway::TypingStartEvent} | The event object. |
350
364
 
351
365
  ### Reaction events
352
366
 
@@ -354,33 +368,33 @@ Fires when a user starts typing.
354
368
 
355
369
  Fires when a reaction is added to a message.
356
370
 
357
- | Parameter | Type | Description |
358
- | ---------- | ----- | ----------- |
359
- |`event` | {Discorb::Gateway::ReactionEvent}| The event object. |
371
+ | Parameter | Type | Description |
372
+ | --------- | --------------------------------- | ----------------- |
373
+ | `event` | {Discorb::Gateway::ReactionEvent} | The event object. |
360
374
 
361
375
  #### `reaction_remove(event)`
362
376
 
363
377
  Fires when someone removes a reaction from a message.
364
378
 
365
- | Parameter | Type | Description |
366
- | ---------- | ----- | ----------- |
367
- |`event` | {Discorb::Gateway::ReactionEvent}| The event object. |
379
+ | Parameter | Type | Description |
380
+ | --------- | --------------------------------- | ----------------- |
381
+ | `event` | {Discorb::Gateway::ReactionEvent} | The event object. |
368
382
 
369
383
  #### `reaction_remove_all(event)`
370
384
 
371
385
  Fires when all reactions are removed from a message.
372
386
 
373
- | Parameter | Type | Description |
374
- | ---------- | ----- | ----------- |
375
- |`event` | {Discorb::Gateway::ReactionRemoveAllEvent}| The event object. |
387
+ | Parameter | Type | Description |
388
+ | --------- | ------------------------------------------ | ----------------- |
389
+ | `event` | {Discorb::Gateway::ReactionRemoveAllEvent} | The event object. |
376
390
 
377
391
  #### `reaction_remove_emoji(event)`
378
392
 
379
393
  Fires when a reaction is removed from a message.
380
394
 
381
- | Parameter | Type | Description |
382
- | ---------- | ----- | ----------- |
383
- |`event` | {Discorb::Gateway::ReactionRemoveEmojiEvent}| The event object. |
395
+ | Parameter | Type | Description |
396
+ | --------- | -------------------------------------------- | ----------------- |
397
+ | `event` | {Discorb::Gateway::ReactionRemoveEmojiEvent} | The event object. |
384
398
 
385
399
  ### Role events
386
400
 
@@ -388,26 +402,26 @@ Fires when a reaction is removed from a message.
388
402
 
389
403
  Fires when a role is created.
390
404
 
391
- | Parameter | Type | Description |
392
- | ---------- | ----- | ----------- |
393
- |`role` | {Discorb::Role}| The created role. |
405
+ | Parameter | Type | Description |
406
+ | --------- | --------------- | ----------------- |
407
+ | `role` | {Discorb::Role} | The created role. |
394
408
 
395
409
  #### `role_update(before, after)`
396
410
 
397
411
  Fires when a role is updated.
398
412
 
399
- | Parameter | Type | Description |
400
- | ---------- | ----- | ----------- |
401
- |`before` | {Discorb::Role}| The role before the update. |
402
- |`after` | {Discorb::Role}| The role after the update. |
413
+ | Parameter | Type | Description |
414
+ | --------- | --------------- | --------------------------- |
415
+ | `before` | {Discorb::Role} | The role before the update. |
416
+ | `after` | {Discorb::Role} | The role after the update. |
403
417
 
404
418
  #### `role_remove(role)`
405
419
 
406
420
  Fires when a role is deleted.
407
421
 
408
- | Parameter | Type | Description |
409
- | ---------- | ----- | ----------- |
410
- |`role` | {Discorb::Role}| The deleted role. |
422
+ | Parameter | Type | Description |
423
+ | --------- | --------------- | ----------------- |
424
+ | `role` | {Discorb::Role} | The deleted role. |
411
425
 
412
426
  ### Member events
413
427
 
@@ -419,26 +433,26 @@ These events require the `guild_members` intent.
419
433
 
420
434
  Fires when a member joins a guild.
421
435
 
422
- | Parameter | Type | Description |
423
- | ---------- | ----- | ----------- |
424
- |`member` | {Discorb::Member}| The member that joined. |
436
+ | Parameter | Type | Description |
437
+ | --------- | ----------------- | ----------------------- |
438
+ | `member` | {Discorb::Member} | The member that joined. |
425
439
 
426
440
  #### `member_update(before, after)`
427
441
 
428
442
  Fires when a member is updated.
429
443
 
430
- | Parameter | Type | Description |
431
- | ---------- | ----- | ----------- |
432
- |`before` | {Discorb::Member}| The member before the update. |
433
- |`after` | {Discorb::Member}| The member after the update. |
444
+ | Parameter | Type | Description |
445
+ | --------- | ----------------- | ----------------------------- |
446
+ | `before` | {Discorb::Member} | The member before the update. |
447
+ | `after` | {Discorb::Member} | The member after the update. |
434
448
 
435
449
  #### `member_remove(member)`
436
450
 
437
451
  Fires when a member is removed from a guild.
438
452
 
439
- | Parameter | Type | Description |
440
- | ---------- | ----- | ----------- |
441
- |`member` | {Discorb::Member}| The member that left. |
453
+ | Parameter | Type | Description |
454
+ | --------- | ----------------- | --------------------- |
455
+ | `member` | {Discorb::Member} | The member that left. |
442
456
 
443
457
  ### Role events
444
458
 
@@ -446,26 +460,26 @@ Fires when a member is removed from a guild.
446
460
 
447
461
  Fires when a role is created.
448
462
 
449
- | Parameter | Type | Description |
450
- | ---------- | ----- | ----------- |
451
- |`role` | {Discorb::Role}| The created role. |
463
+ | Parameter | Type | Description |
464
+ | --------- | --------------- | ----------------- |
465
+ | `role` | {Discorb::Role} | The created role. |
452
466
 
453
467
  #### `role_update(before, after)`
454
468
 
455
469
  Fires when a role is updated.
456
470
 
457
- | Parameter | Type | Description |
458
- | ---------- | ----- | ----------- |
459
- |`before` | {Discorb::Role}| The role before the update. |
460
- |`after` | {Discorb::Role}| The role after the update. |
471
+ | Parameter | Type | Description |
472
+ | --------- | --------------- | --------------------------- |
473
+ | `before` | {Discorb::Role} | The role before the update. |
474
+ | `after` | {Discorb::Role} | The role after the update. |
461
475
 
462
476
  #### `role_remove(role)`
463
477
 
464
478
  Fires when a role is deleted.
465
479
 
466
- | Parameter | Type | Description |
467
- | ---------- | ----- | ----------- |
468
- |`role` | {Discorb::Role}| The deleted role. |
480
+ | Parameter | Type | Description |
481
+ | --------- | --------------- | ----------------- |
482
+ | `role` | {Discorb::Role} | The deleted role. |
469
483
 
470
484
  ### Invite events
471
485
 
@@ -473,35 +487,85 @@ Fires when a role is deleted.
473
487
 
474
488
  Fires when an invitation is created.
475
489
 
476
- | Parameter | Type | Description |
477
- | ---------- | ----- | ----------- |
478
- |`invite` | {Discorb::Invite}| The created invite. |
490
+ | Parameter | Type | Description |
491
+ | --------- | ----------------- | ------------------- |
492
+ | `invite` | {Discorb::Invite} | The created invite. |
479
493
 
480
494
  #### `invite_delete(invite)`
481
495
 
482
496
  Fires when an invitation is deleted.
483
497
 
484
- | Parameter | Type | Description |
485
- | ---------- | ----- | ----------- |
486
- |`invite` | {Discorb::Invite}| The deleted invite. |
498
+ | Parameter | Type | Description |
499
+ | --------- | ----------------- | ------------------- |
500
+ | `invite` | {Discorb::Invite} | The deleted invite. |
487
501
 
488
502
  ### Interaction events
489
503
 
504
+ #### `interaction_create(interaction)`
505
+
506
+ Fires when an interaction is created. This will fire for all interactions.
507
+
508
+ | Parameter | Type | Description |
509
+ | ------------- | ---------------------- | ------------------------ |
510
+ | `interaction` | {Discorb::Interaction} | The created interaction. |
511
+
512
+ #### `application_command(interaction)`
513
+
514
+ Fires when an application command is used.
515
+
516
+ | Parameter | Type | Description |
517
+ | ------------- | ----------------------------- | ------------------------ |
518
+ | `interaction` | {Discorb::CommandInteraction} | The created interaction. |
519
+
520
+ #### `slash_command(interaction)`
521
+
522
+ Fires when a slash command is used.
523
+
524
+ | Parameter | Type | Description |
525
+ | ------------- | ----------------------------------------------- | ------------------------ |
526
+ | `interaction` | {Discorb::CommandInteraction::ChatInputCommand} | The created interaction. |
527
+
528
+ #### `message_command(interaction)`
529
+
530
+ Fires when a message command is used.
531
+
532
+ | Parameter | Type | Description |
533
+ | ------------- | ------------------------------------------------- | ------------------------ |
534
+ | `interaction` | {Discorb::CommandInteraction::MessageMenuCommand} | The created interaction. |
535
+
536
+ #### `user_command(interaction)`
537
+
538
+ Fires when a user command is used.
539
+
540
+ | Parameter | Type | Description |
541
+ | ------------- | ---------------------------------------------- | ------------------------ |
542
+ | `interaction` | {Discorb::CommandInteraction::UserMenuCommand} | The created interaction. |
543
+
490
544
  #### `button_click(interaction)`
491
545
 
492
546
  Fires when a button is clicked.
493
547
 
494
- | Parameter | Type | Description |
495
- | ---------- | ----- | ----------- |
496
- |`interaction`| {Discorb::MessageComponentInteraction::Button}| The interaction object. |
548
+ | Parameter | Type | Description |
549
+ | ------------- | ---------------------------------------------- | ----------------------- |
550
+ | `interaction` | {Discorb::MessageComponentInteraction::Button} | The interaction object. |
497
551
 
498
552
  #### `select_menu_select(interaction)`
499
553
 
500
554
  Fires when a select menu is selected.
501
555
 
502
- | Parameter | Type | Description |
503
- | ---------- | ----- | ----------- |
504
- |`interaction`| {Discorb::MessageComponentInteraction::SelectMenu}| The interaction object. |
556
+ | Parameter | Type | Description |
557
+ | ------------- | -------------------------------------------------- | ----------------------- |
558
+ | `interaction` | {Discorb::MessageComponentInteraction::SelectMenu} | The interaction object. |
559
+
560
+ #### `form_submit(interaction)`
561
+
562
+ Fires when a form is submitted.
563
+
564
+ | Parameter | Type | Description |
565
+ | ------------- | --------------------------- | ----------------------- |
566
+ | `interaction` | {Discorb::ModalInteraction} | The interaction object. |
567
+
568
+ #### `slash_command
505
569
 
506
570
  ### Voice events
507
571
 
@@ -513,42 +577,42 @@ Because it's big, it's documented in {file:docs/voice_events.md}.
513
577
 
514
578
  Fires when a scheduled event is created.
515
579
 
516
- | Parameter | Type | Description |
517
- | ---------- | ----- | ----------- |
518
- | `event` | {Discorb::ScheduledEvent}| The created scheduled event. |
580
+ | Parameter | Type | Description |
581
+ | --------- | ------------------------- | ---------------------------- |
582
+ | `event` | {Discorb::ScheduledEvent} | The created scheduled event. |
519
583
 
520
584
  #### `scheduled_event_cancel(event)`, `scheduled_event_delete(event)`
521
585
 
522
586
  Fires when a scheduled event is canceled or deleted.
523
587
 
524
- | Parameter | Type | Description |
525
- | ---------- | ----- | ----------- |
526
- | `event` | {Discorb::ScheduledEvent}| The deleted scheduled event. |
588
+ | Parameter | Type | Description |
589
+ | --------- | ------------------------- | ---------------------------- |
590
+ | `event` | {Discorb::ScheduledEvent} | The deleted scheduled event. |
527
591
 
528
592
  #### `scheduled_event_edit(before, after)`
529
593
 
530
594
  Fires when a scheduled event is edited.
531
595
 
532
- | Parameter | Type | Description |
533
- | ---------- | ----- | ----------- |
534
- | `before` | {Discorb::ScheduledEvent}| The scheduled event before the edit. |
535
- | `after` | {Discorb::ScheduledEvent}| The scheduled event after the edit. |
596
+ | Parameter | Type | Description |
597
+ | --------- | ------------------------- | ------------------------------------ |
598
+ | `before` | {Discorb::ScheduledEvent} | The scheduled event before the edit. |
599
+ | `after` | {Discorb::ScheduledEvent} | The scheduled event after the edit. |
536
600
 
537
601
  #### `scheduled_event_start(event)`
538
602
 
539
603
  Fires when a scheduled event is started.
540
604
 
541
- | Parameter | Type | Description |
542
- | ---------- | ----- | ----------- |
543
- | `event` | {Discorb::ScheduledEvent}| The scheduled event that started. |
605
+ | Parameter | Type | Description |
606
+ | --------- | ------------------------- | --------------------------------- |
607
+ | `event` | {Discorb::ScheduledEvent} | The scheduled event that started. |
544
608
 
545
609
  #### `scheduled_event_end(event)`
546
610
 
547
611
  Fires when a scheduled event is ended.
548
612
 
549
- | Parameter | Type | Description |
550
- | ---------- | ----- | ----------- |
551
- | `event` | {Discorb::ScheduledEvent}| The scheduled event that ended. |
613
+ | Parameter | Type | Description |
614
+ | --------- | ------------------------- | ------------------------------- |
615
+ | `event` | {Discorb::ScheduledEvent} | The scheduled event that ended. |
552
616
 
553
617
  ### Low-level events
554
618
 
@@ -556,31 +620,31 @@ Fires when a scheduled event is ended.
556
620
 
557
621
  Fires when `GUILD_CREATE` is received.
558
622
 
559
- | Parameter | Type | Description |
560
- | ---------- | ----- | ----------- |
561
- |`guild` | {Discorb::Guild}| The guild of the event. |
623
+ | Parameter | Type | Description |
624
+ | --------- | ---------------- | ----------------------- |
625
+ | `guild` | {Discorb::Guild} | The guild of the event. |
562
626
 
563
627
  #### `guild_delete(guild)`
564
628
 
565
629
  Fires when `GUILD_DELETE` is received.
566
630
 
567
- | Parameter | Type | Description |
568
- | ---------- | ----- | ----------- |
569
- |`guild` | {Discorb::Guild}| The guild of the event. |
631
+ | Parameter | Type | Description |
632
+ | --------- | ---------------- | ----------------------- |
633
+ | `guild` | {Discorb::Guild} | The guild of the event. |
570
634
 
571
635
  #### `thread_create(thread)`
572
636
 
573
637
  Fires when `THREAD_CREATE` is received.
574
638
 
575
- | Parameter | Type | Description |
576
- | ---------- | ----- | ----------- |
577
- |`thread` | {Discorb::ThreadChannel}| The thread of the event. |
639
+ | Parameter | Type | Description |
640
+ | --------- | ------------------------ | ------------------------ |
641
+ | `thread` | {Discorb::ThreadChannel} | The thread of the event. |
578
642
 
579
643
  #### `scheduled_event_update(before, after)`
580
644
 
581
645
  Fires when `SCHEDULED_EVENT_UPDATE` is received.
582
646
 
583
- | Parameter | Type | Description |
584
- | ---------- | ----- | ----------- |
585
- | `before` | {Discorb::ScheduledEvent}| The scheduled event before the update. |
586
- |`after` | {Discorb::ScheduledEvent}| The scheduled event after the update. |
647
+ | Parameter | Type | Description |
648
+ | --------- | ------------------------- | -------------------------------------- |
649
+ | `before` | {Discorb::ScheduledEvent} | The scheduled event before the update. |
650
+ | `after` | {Discorb::ScheduledEvent} | The scheduled event after the update. |