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
data/docs/events.md CHANGED
@@ -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
 
@@ -90,6 +91,12 @@ Fires when the client is resumed connection.
90
91
  Fires when an error occurs during an event.
91
92
  Defaults to printing the error to stderr, override to handle it yourself.
92
93
 
94
+ | Parameter | Type | Description |
95
+ | ------------ | --------------- | --------------------------- |
96
+ | `event_name` | `Symbol` | The name of the event. |
97
+ | `args` | `Array<Object>` | The arguments of the event. |
98
+ | `error` | `Exception` | The error that occurred. |
99
+
93
100
  #### `setup()`
94
101
 
95
102
  Fires when `discorb setup` is run.
@@ -99,17 +106,17 @@ This is useful for setting up some dependencies, such as the database.
99
106
 
100
107
  Fires when a shard is standby.
101
108
 
102
- | Parameter | Type | Description |
103
- | ---------- | ----- | ----------- |
104
- |`shard` | {Discorb::Shard} | The shard that is standby. |
109
+ | Parameter | Type | Description |
110
+ | --------- | ---------------- | -------------------------- |
111
+ | `shard` | {Discorb::Shard} | The shard that is standby. |
105
112
 
106
113
  #### `shard_resumed(shard)`
107
114
 
108
115
  Fires when a shard is resumed connection.
109
116
 
110
- | Parameter | Type | Description |
111
- | ---------- | ----- | ----------- |
112
- |`shard` | {Discorb::Shard} | The shard that is standby. |
117
+ | Parameter | Type | Description |
118
+ | --------- | ---------------- | -------------------------- |
119
+ | `shard` | {Discorb::Shard} | The shard that is standby. |
113
120
 
114
121
  ### Guild events
115
122
 
@@ -117,69 +124,68 @@ Fires when a shard is resumed connection.
117
124
 
118
125
  Fires when client joins a guild.
119
126
 
120
- | Parameter | Type | Description |
121
- | ---------- | ----- | ----------- |
122
- |`guild` | {Discorb::Guild} | The guild that was joined. |
127
+ | Parameter | Type | Description |
128
+ | --------- | ---------------- | -------------------------- |
129
+ | `guild` | {Discorb::Guild} | The guild that was joined. |
123
130
 
124
131
  #### `guild_available(guild)`
125
132
 
126
133
  Fires when a guild becomes available.
127
134
 
128
- | Parameter | Type | Description |
129
- | ---------- | ----- | ----------- |
130
- |`guild` | {Discorb::Guild} | The guild that became available. |
135
+ | Parameter | Type | Description |
136
+ | --------- | ---------------- | -------------------------------- |
137
+ | `guild` | {Discorb::Guild} | The guild that became available. |
131
138
 
132
139
  #### `guild_update(before, after)`
133
140
 
134
141
  Fires when client updates a guild.
135
142
 
136
- | Parameter | Type | Description |
137
- | ---------- | ----- | ----------- |
138
- |`before` | {Discorb::Guild} | The guild before the update. |
139
- |`after` | {Discorb::Guild} | The guild after the update. |
143
+ | Parameter | Type | Description |
144
+ | --------- | ---------------- | ---------------------------- |
145
+ | `before` | {Discorb::Guild} | The guild before the update. |
146
+ | `after` | {Discorb::Guild} | The guild after the update. |
140
147
 
141
148
  #### `guild_leave(guild)`
142
149
 
143
150
  Fires when client leaves a guild.
144
151
 
145
- | Parameter | Type | Description |
146
- | ---------- | ----- | ----------- |
147
- |`guild` | {Discorb::Guild} | The guild that was left. |
152
+ | Parameter | Type | Description |
153
+ | --------- | ---------------- | ------------------------ |
154
+ | `guild` | {Discorb::Guild} | The guild that was left. |
148
155
 
149
156
  #### `guild_destroy(guild)`
150
157
 
151
158
  Fires when guild is destroyed.
152
159
 
153
- | Parameter | Type | Description |
154
- | ---------- | ----- | ----------- |
155
- |`guild` | {Discorb::Guild} | The guild that was destroyed. |
160
+ | Parameter | Type | Description |
161
+ | --------- | ---------------- | ----------------------------- |
162
+ | `guild` | {Discorb::Guild} | The guild that was destroyed. |
156
163
 
157
164
  #### `guild_integrations_update(guild)`
158
165
 
159
166
  Fires when guild integrations are updated.
160
167
 
161
- | Parameter | Type | Description |
162
- | ---------- | ----- | ----------- |
163
- |`guild` | {Discorb::Guild} | The guild that integrations were updated for. |
168
+ | Parameter | Type | Description |
169
+ | --------- | ---------------- | --------------------------------------------- |
170
+ | `guild` | {Discorb::Guild} | The guild that integrations were updated for. |
164
171
 
165
172
  #### `guild_ban_add(guild, user)`
166
173
 
167
174
  Fires when a user is banned from a guild.
168
175
 
169
-
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. |
176
+ | Parameter | Type | Description |
177
+ | --------- | ---------------- | ---------------------------------------- |
178
+ | `guild` | {Discorb::Guild} | The guild that the user was banned from. |
179
+ | `user` | {Discorb::User} | The user that was banned. |
174
180
 
175
181
  #### `guild_ban_remove(guild, user)`
176
182
 
177
183
  Fires when a user is unbanned from a guild.
178
184
 
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. |
185
+ | Parameter | Type | Description |
186
+ | --------- | ---------------- | ------------------------------------------ |
187
+ | `guild` | {Discorb::Guild} | The guild that the user was unbanned from. |
188
+ | `user` | {Discorb::User} | The user that was unbanned. |
183
189
 
184
190
  ### Channel events
185
191
 
@@ -187,88 +193,87 @@ Fires when a user is unbanned from a guild.
187
193
 
188
194
  Fires when a channel is created.
189
195
 
190
- | Parameter | Type | Description |
191
- | ---------- | ----- | ----------- |
192
- |`channel` | {Discorb::Channel} | The channel that was created. |
196
+ | Parameter | Type | Description |
197
+ | --------- | ------------------ | ----------------------------- |
198
+ | `channel` | {Discorb::Channel} | The channel that was created. |
193
199
 
194
200
  #### `channel_update(before, after)`
195
201
 
196
202
  Fires when a channel is updated.
197
203
 
198
- | Parameter | Type | Description |
199
- | ---------- | ----- | ----------- |
200
- |`before` | {Discorb::Channel} | The channel before the update. |
201
- |`after` | {Discorb::Channel} | The channel after the update. |
204
+ | Parameter | Type | Description |
205
+ | --------- | ------------------ | ------------------------------ |
206
+ | `before` | {Discorb::Channel} | The channel before the update. |
207
+ | `after` | {Discorb::Channel} | The channel after the update. |
202
208
 
203
209
  #### `channel_delete(channel)`
204
210
 
205
211
  Fires when a channel is deleted.
206
212
 
207
- | Parameter | Type | Description |
208
- | ---------- | ----- | ----------- |
209
- |`channel` | {Discorb::Channel} | The channel that was deleted. |
213
+ | Parameter | Type | Description |
214
+ | --------- | ------------------ | ----------------------------- |
215
+ | `channel` | {Discorb::Channel} | The channel that was deleted. |
210
216
 
211
217
  #### `webhooks_update(event)`
212
218
 
213
219
  Fires when a webhook is updated.
214
220
 
215
- | Parameter | Type | Description |
216
- | ---------- | ----- | ----------- |
217
- |`event` | {Discorb::Gateway::WebhooksUpdateEvent} | The webhook update event. |
221
+ | Parameter | Type | Description |
222
+ | --------- | --------------------------------------- | ------------------------- |
223
+ | `event` | {Discorb::Gateway::WebhooksUpdateEvent} | The webhook update event. |
218
224
 
219
225
  #### `thread_new(thread)`
220
226
 
221
227
  Fires when a thread is created.
222
228
 
223
- | Parameter | Type | Description |
224
- | ---------- | ----- | ----------- |
225
- |`thread` | {Discorb::ThreadChannel} | The thread that was created. |
229
+ | Parameter | Type | Description |
230
+ | --------- | ------------------------ | ---------------------------- |
231
+ | `thread` | {Discorb::ThreadChannel} | The thread that was created. |
226
232
 
227
233
  #### `thread_join(thread)`
228
234
 
229
235
  Fires when client joins a thread.
230
236
 
231
- | Parameter | Type | Description |
232
- | ---------- | ----- | ----------- |
233
- |`thread` | {Discorb::ThreadChannel} | The thread that was joined. |
234
-
237
+ | Parameter | Type | Description |
238
+ | --------- | ------------------------ | --------------------------- |
239
+ | `thread` | {Discorb::ThreadChannel} | The thread that was joined. |
235
240
 
236
241
  #### `thread_delete(thread)`
237
242
 
238
243
  Fires when a thread is deleted.
239
244
 
240
- | Parameter | Type | Description |
241
- | ---------- | ----- | ----------- |
242
- |`thread` | {Discorb::ThreadChannel} | The thread that was deleted. |
245
+ | Parameter | Type | Description |
246
+ | --------- | ------------------------ | ---------------------------- |
247
+ | `thread` | {Discorb::ThreadChannel} | The thread that was deleted. |
243
248
 
244
249
  #### `thread_update(before, after)`
245
250
 
246
251
  Fires when a thread is updated.
247
252
 
248
- | Parameter | Type | Description |
249
- | ---------- | ----- | ----------- |
250
- |`before` | {Discorb::ThreadChannel} | The thread before the update. |
251
- |`after` | {Discorb::ThreadChannel} | The thread after the update. |
253
+ | Parameter | Type | Description |
254
+ | --------- | ------------------------ | ----------------------------- |
255
+ | `before` | {Discorb::ThreadChannel} | The thread before the update. |
256
+ | `after` | {Discorb::ThreadChannel} | The thread after the update. |
252
257
 
253
258
  #### `thread_members_update(thread, added, removed)`
254
259
 
255
260
  Fires when a thread's members are updated.
256
261
 
257
- | Parameter | Type | Description |
258
- | ---------- | ----- | ----------- |
259
- |`thread` | {Discorb::ThreadChannel} | The thread that the members were updated for. |
260
- |`added` | Array<{Discorb::ThreadChannel::Member}> | An array of {Discorb::ThreadChannel::Member} objects that were added to the thread. |
261
- |`removed` | Array<{Discorb::ThreadChannel::Member}> | An array of {Discorb::ThreadChannel::Member} objects that were removed from the thread. |
262
+ | Parameter | Type | Description |
263
+ | --------- | --------------------------------------- | --------------------------------------------------------------------------------------- |
264
+ | `thread` | {Discorb::ThreadChannel} | The thread that the members were updated for. |
265
+ | `added` | Array<{Discorb::ThreadChannel::Member}> | An array of {Discorb::ThreadChannel::Member} objects that were added to the thread. |
266
+ | `removed` | Array<{Discorb::ThreadChannel::Member}> | An array of {Discorb::ThreadChannel::Member} objects that were removed from the thread. |
262
267
 
263
268
  #### `thread_member_update(before, after)`
264
269
 
265
270
  Fires when a thread member is updated.
266
271
 
267
- | Parameter | Type | Description |
268
- | --------- | ----- | ----------- |
269
- |`thread` | {Discorb::ThreadChannel} | The thread that the member was updated for. |
270
- |`before` | {Discorb::ThreadChannel::Member} | The thread member before the update. |
271
- |`after` | {Discorb::ThreadChannel::Member} | The thread member after the update. |
272
+ | Parameter | Type | Description |
273
+ | --------- | -------------------------------- | ------------------------------------------- |
274
+ | `thread` | {Discorb::ThreadChannel} | The thread that the member was updated for. |
275
+ | `before` | {Discorb::ThreadChannel::Member} | The thread member before the update. |
276
+ | `after` | {Discorb::ThreadChannel::Member} | The thread member after the update. |
272
277
 
273
278
  ### Integration events
274
279
 
@@ -276,26 +281,25 @@ Fires when a thread member is updated.
276
281
 
277
282
  Fires when a guild integration is created.
278
283
 
279
- | Parameter | Type | Description |
280
- | ---------- | ----- | ----------- |
281
- |`integration`| {Discorb::Integration}| The created integration. |
284
+ | Parameter | Type | Description |
285
+ | ------------- | ---------------------- | ------------------------ |
286
+ | `integration` | {Discorb::Integration} | The created integration. |
282
287
 
283
288
  #### `integration_update(after)`
284
289
 
285
290
  Fires when a guild integration is updated.
286
291
 
287
-
288
- | Parameter | Type | Description |
289
- | ---------- | ----- | ----------- |
290
- |`after` | {Discorb::Integration}| The integration after the update. |
292
+ | Parameter | Type | Description |
293
+ | --------- | ---------------------- | --------------------------------- |
294
+ | `after` | {Discorb::Integration} | The integration after the update. |
291
295
 
292
296
  #### `integration_delete(integration)`
293
297
 
294
298
  Fires when a guild integration is deleted.
295
299
 
296
- | Parameter | Type | Description |
297
- | ---------- | ----- | ----------- |
298
- |`integration`| {Discorb::Integration}| The deleted integration. |
300
+ | Parameter | Type | Description |
301
+ | ------------- | ---------------------- | ------------------------ |
302
+ | `integration` | {Discorb::Integration} | The deleted integration. |
299
303
 
300
304
  ### Message events
301
305
 
@@ -303,27 +307,27 @@ Fires when a guild integration is deleted.
303
307
 
304
308
  Fires when a message is created.
305
309
 
306
- | Parameter | Type | Description |
307
- | ---------- | ----- | ----------- |
308
- |`message` | {Discorb::Message}| The created message. |
310
+ | Parameter | Type | Description |
311
+ | --------- | ------------------ | -------------------- |
312
+ | `message` | {Discorb::Message} | The created message. |
309
313
 
310
314
  #### `message_update(event)`
311
315
 
312
316
  Fires when a message is updated.
313
317
 
314
- | Parameter | Type | Description |
315
- | ---------- | ----- | ----------- |
316
- |`event` | {Discorb::Gateway::MessageUpdateEvent}| The message after the update. |
318
+ | Parameter | Type | Description |
319
+ | --------- | -------------------------------------- | ----------------------------- |
320
+ | `event` | {Discorb::Gateway::MessageUpdateEvent} | The message after the update. |
317
321
 
318
322
  #### `message_delete(message, channel, guild)`
319
323
 
320
324
  Fires when a message is deleted.
321
325
 
322
- | Parameter | Type | Description |
323
- | ---------- | ----- | ----------- |
324
- |`message` | {Discorb::Message}| The deleted message. |
325
- |`channel` | {Discorb::Channel}| The channel the message was deleted from. |
326
- |`guild` | ?{Discorb::Guild} | The guild the message was deleted from. |
326
+ | Parameter | Type | Description |
327
+ | --------- | ------------------ | ----------------------------------------- |
328
+ | `message` | {Discorb::Message} | The deleted message. |
329
+ | `channel` | {Discorb::Channel} | The channel the message was deleted from. |
330
+ | `guild` | ?{Discorb::Guild} | The guild the message was deleted from. |
327
331
 
328
332
  ##### Note
329
333
 
@@ -334,35 +338,35 @@ This will fire when cached messages are deleted.
334
338
  Fires when a message is deleted.
335
339
  Not like {file:#message_delete} this will fire even message is not cached.
336
340
 
337
- | Parameter | Type | Description |
338
- | ---------- | ----- | ----------- |
339
- |`message_id`| {Discorb::Snowflake} | The deleted message ID. |
340
- |`channel` | {Discorb::Channel}| The channel the message was deleted from. |
341
- |`guild` | ?{Discorb::Guild} | The guild the message was deleted from. |
341
+ | Parameter | Type | Description |
342
+ | ------------ | -------------------- | ----------------------------------------- |
343
+ | `message_id` | {Discorb::Snowflake} | The deleted message ID. |
344
+ | `channel` | {Discorb::Channel} | The channel the message was deleted from. |
345
+ | `guild` | ?{Discorb::Guild} | The guild the message was deleted from. |
342
346
 
343
347
  #### `message_delete_bulk(messages)`
344
348
 
345
349
  Fires when a bulk of messages are deleted.
346
350
 
347
- | Parameter | Type | Description |
348
- | ---------- | ----- | ----------- |
349
- |`messages` | Array<{Discorb::Message}, {Discorb::Gateway::UnknownDeleteBulkMessage}> | The deleted messages. |
351
+ | Parameter | Type | Description |
352
+ | ---------- | ----------------------------------------------------------------------- | --------------------- |
353
+ | `messages` | Array<{Discorb::Message}, {Discorb::Gateway::UnknownDeleteBulkMessage}> | The deleted messages. |
350
354
 
351
355
  #### `message_pin_update(event)`
352
356
 
353
357
  Fires when a message is pinned or unpinned.
354
358
 
355
- | Parameter | Type | Description |
356
- | ---------- | ----- | ----------- |
357
- |`event` | {Discorb::Gateway::MessagePinEvent}| The event object. |
359
+ | Parameter | Type | Description |
360
+ | --------- | ----------------------------------- | ----------------- |
361
+ | `event` | {Discorb::Gateway::MessagePinEvent} | The event object. |
358
362
 
359
363
  #### `typing_start(event)`
360
364
 
361
365
  Fires when a user starts typing.
362
366
 
363
- | Parameter | Type | Description |
364
- | --------- | ----- | ----------- |
365
- |`event` | {Discorb::Gateway::TypingStartEvent}| The event object. |
367
+ | Parameter | Type | Description |
368
+ | --------- | ------------------------------------ | ----------------- |
369
+ | `event` | {Discorb::Gateway::TypingStartEvent} | The event object. |
366
370
 
367
371
  ### Reaction events
368
372
 
@@ -370,33 +374,33 @@ Fires when a user starts typing.
370
374
 
371
375
  Fires when a reaction is added to a message.
372
376
 
373
- | Parameter | Type | Description |
374
- | ---------- | ----- | ----------- |
375
- |`event` | {Discorb::Gateway::ReactionEvent}| The event object. |
377
+ | Parameter | Type | Description |
378
+ | --------- | --------------------------------- | ----------------- |
379
+ | `event` | {Discorb::Gateway::ReactionEvent} | The event object. |
376
380
 
377
381
  #### `reaction_remove(event)`
378
382
 
379
383
  Fires when someone removes a reaction from a message.
380
384
 
381
- | Parameter | Type | Description |
382
- | ---------- | ----- | ----------- |
383
- |`event` | {Discorb::Gateway::ReactionEvent}| The event object. |
385
+ | Parameter | Type | Description |
386
+ | --------- | --------------------------------- | ----------------- |
387
+ | `event` | {Discorb::Gateway::ReactionEvent} | The event object. |
384
388
 
385
389
  #### `reaction_remove_all(event)`
386
390
 
387
391
  Fires when all reactions are removed from a message.
388
392
 
389
- | Parameter | Type | Description |
390
- | ---------- | ----- | ----------- |
391
- |`event` | {Discorb::Gateway::ReactionRemoveAllEvent}| The event object. |
393
+ | Parameter | Type | Description |
394
+ | --------- | ------------------------------------------ | ----------------- |
395
+ | `event` | {Discorb::Gateway::ReactionRemoveAllEvent} | The event object. |
392
396
 
393
397
  #### `reaction_remove_emoji(event)`
394
398
 
395
399
  Fires when a reaction is removed from a message.
396
400
 
397
- | Parameter | Type | Description |
398
- | ---------- | ----- | ----------- |
399
- |`event` | {Discorb::Gateway::ReactionRemoveEmojiEvent}| The event object. |
401
+ | Parameter | Type | Description |
402
+ | --------- | -------------------------------------------- | ----------------- |
403
+ | `event` | {Discorb::Gateway::ReactionRemoveEmojiEvent} | The event object. |
400
404
 
401
405
  ### Role events
402
406
 
@@ -404,26 +408,26 @@ Fires when a reaction is removed from a message.
404
408
 
405
409
  Fires when a role is created.
406
410
 
407
- | Parameter | Type | Description |
408
- | ---------- | ----- | ----------- |
409
- |`role` | {Discorb::Role}| The created role. |
411
+ | Parameter | Type | Description |
412
+ | --------- | --------------- | ----------------- |
413
+ | `role` | {Discorb::Role} | The created role. |
410
414
 
411
415
  #### `role_update(before, after)`
412
416
 
413
417
  Fires when a role is updated.
414
418
 
415
- | Parameter | Type | Description |
416
- | ---------- | ----- | ----------- |
417
- |`before` | {Discorb::Role}| The role before the update. |
418
- |`after` | {Discorb::Role}| The role after the update. |
419
+ | Parameter | Type | Description |
420
+ | --------- | --------------- | --------------------------- |
421
+ | `before` | {Discorb::Role} | The role before the update. |
422
+ | `after` | {Discorb::Role} | The role after the update. |
419
423
 
420
424
  #### `role_remove(role)`
421
425
 
422
426
  Fires when a role is deleted.
423
427
 
424
- | Parameter | Type | Description |
425
- | ---------- | ----- | ----------- |
426
- |`role` | {Discorb::Role}| The deleted role. |
428
+ | Parameter | Type | Description |
429
+ | --------- | --------------- | ----------------- |
430
+ | `role` | {Discorb::Role} | The deleted role. |
427
431
 
428
432
  ### Member events
429
433
 
@@ -435,26 +439,26 @@ These events require the `guild_members` intent.
435
439
 
436
440
  Fires when a member joins a guild.
437
441
 
438
- | Parameter | Type | Description |
439
- | ---------- | ----- | ----------- |
440
- |`member` | {Discorb::Member}| The member that joined. |
442
+ | Parameter | Type | Description |
443
+ | --------- | ----------------- | ----------------------- |
444
+ | `member` | {Discorb::Member} | The member that joined. |
441
445
 
442
446
  #### `member_update(before, after)`
443
447
 
444
448
  Fires when a member is updated.
445
449
 
446
- | Parameter | Type | Description |
447
- | ---------- | ----- | ----------- |
448
- |`before` | {Discorb::Member}| The member before the update. |
449
- |`after` | {Discorb::Member}| The member after the update. |
450
+ | Parameter | Type | Description |
451
+ | --------- | ----------------- | ----------------------------- |
452
+ | `before` | {Discorb::Member} | The member before the update. |
453
+ | `after` | {Discorb::Member} | The member after the update. |
450
454
 
451
455
  #### `member_remove(member)`
452
456
 
453
457
  Fires when a member is removed from a guild.
454
458
 
455
- | Parameter | Type | Description |
456
- | ---------- | ----- | ----------- |
457
- |`member` | {Discorb::Member}| The member that left. |
459
+ | Parameter | Type | Description |
460
+ | --------- | ----------------- | --------------------- |
461
+ | `member` | {Discorb::Member} | The member that left. |
458
462
 
459
463
  ### Role events
460
464
 
@@ -462,26 +466,26 @@ Fires when a member is removed from a guild.
462
466
 
463
467
  Fires when a role is created.
464
468
 
465
- | Parameter | Type | Description |
466
- | ---------- | ----- | ----------- |
467
- |`role` | {Discorb::Role}| The created role. |
469
+ | Parameter | Type | Description |
470
+ | --------- | --------------- | ----------------- |
471
+ | `role` | {Discorb::Role} | The created role. |
468
472
 
469
473
  #### `role_update(before, after)`
470
474
 
471
475
  Fires when a role is updated.
472
476
 
473
- | Parameter | Type | Description |
474
- | ---------- | ----- | ----------- |
475
- |`before` | {Discorb::Role}| The role before the update. |
476
- |`after` | {Discorb::Role}| The role after the update. |
477
+ | Parameter | Type | Description |
478
+ | --------- | --------------- | --------------------------- |
479
+ | `before` | {Discorb::Role} | The role before the update. |
480
+ | `after` | {Discorb::Role} | The role after the update. |
477
481
 
478
482
  #### `role_remove(role)`
479
483
 
480
484
  Fires when a role is deleted.
481
485
 
482
- | Parameter | Type | Description |
483
- | ---------- | ----- | ----------- |
484
- |`role` | {Discorb::Role}| The deleted role. |
486
+ | Parameter | Type | Description |
487
+ | --------- | --------------- | ----------------- |
488
+ | `role` | {Discorb::Role} | The deleted role. |
485
489
 
486
490
  ### Invite events
487
491
 
@@ -489,17 +493,17 @@ Fires when a role is deleted.
489
493
 
490
494
  Fires when an invitation is created.
491
495
 
492
- | Parameter | Type | Description |
493
- | ---------- | ----- | ----------- |
494
- |`invite` | {Discorb::Invite}| The created invite. |
496
+ | Parameter | Type | Description |
497
+ | --------- | ----------------- | ------------------- |
498
+ | `invite` | {Discorb::Invite} | The created invite. |
495
499
 
496
500
  #### `invite_delete(invite)`
497
501
 
498
502
  Fires when an invitation is deleted.
499
503
 
500
- | Parameter | Type | Description |
501
- | ---------- | ----- | ----------- |
502
- |`invite` | {Discorb::Invite}| The deleted invite. |
504
+ | Parameter | Type | Description |
505
+ | --------- | ----------------- | ------------------- |
506
+ | `invite` | {Discorb::Invite} | The deleted invite. |
503
507
 
504
508
  ### Interaction events
505
509
 
@@ -507,68 +511,66 @@ Fires when an invitation is deleted.
507
511
 
508
512
  Fires when an interaction is created. This will fire for all interactions.
509
513
 
510
- | Parameter | Type | Description |
511
- | ---------- | ----- | ----------- |
512
- | `interaction` | {Discorb::Interaction}| The created interaction. |
514
+ | Parameter | Type | Description |
515
+ | ------------- | ---------------------- | ------------------------ |
516
+ | `interaction` | {Discorb::Interaction} | The created interaction. |
513
517
 
514
518
  #### `application_command(interaction)`
515
519
 
516
520
  Fires when an application command is used.
517
521
 
518
- | Parameter | Type | Description |
519
- | ---------- | ----- | ----------- |
520
- | `interaction` | {Discorb::CommandInteraction}| The created interaction. |
522
+ | Parameter | Type | Description |
523
+ | ------------- | ----------------------------- | ------------------------ |
524
+ | `interaction` | {Discorb::CommandInteraction} | The created interaction. |
521
525
 
522
526
  #### `slash_command(interaction)`
523
527
 
524
528
  Fires when a slash command is used.
525
529
 
526
- | Parameter | Type | Description |
527
- | ---------- | ----- | ----------- |
528
- | `interaction` | {Discorb::CommandInteraction::SlashCommand}| The created interaction. |
530
+ | Parameter | Type | Description |
531
+ | ------------- | ----------------------------------------------- | ------------------------ |
532
+ | `interaction` | {Discorb::CommandInteraction::ChatInputCommand} | The created interaction. |
529
533
 
530
534
  #### `message_command(interaction)`
531
535
 
532
536
  Fires when a message command is used.
533
537
 
534
- | Parameter | Type | Description |
535
- | ---------- | ----- | ----------- |
536
- | `interaction` | {Discorb::CommandInteraction::MessageMenuCommand}| The created interaction. |
538
+ | Parameter | Type | Description |
539
+ | ------------- | ------------------------------------------------- | ------------------------ |
540
+ | `interaction` | {Discorb::CommandInteraction::MessageMenuCommand} | The created interaction. |
537
541
 
538
542
  #### `user_command(interaction)`
539
543
 
540
544
  Fires when a user command is used.
541
545
 
542
- | Parameter | Type | Description |
543
- | ---------- | ----- | ----------- |
544
- | `interaction` | {Discorb::CommandInteraction::UserMenuCommand}| The created interaction. |
546
+ | Parameter | Type | Description |
547
+ | ------------- | ---------------------------------------------- | ------------------------ |
548
+ | `interaction` | {Discorb::CommandInteraction::UserMenuCommand} | The created interaction. |
545
549
 
546
550
  #### `button_click(interaction)`
547
551
 
548
552
  Fires when a button is clicked.
549
553
 
550
- | Parameter | Type | Description |
551
- | ---------- | ----- | ----------- |
552
- |`interaction`| {Discorb::MessageComponentInteraction::Button}| The interaction object. |
554
+ | Parameter | Type | Description |
555
+ | ------------- | ---------------------------------------------- | ----------------------- |
556
+ | `interaction` | {Discorb::MessageComponentInteraction::Button} | The interaction object. |
553
557
 
554
558
  #### `select_menu_select(interaction)`
555
559
 
556
560
  Fires when a select menu is selected.
557
561
 
558
- | Parameter | Type | Description |
559
- | ---------- | ----- | ----------- |
560
- |`interaction`| {Discorb::MessageComponentInteraction::SelectMenu}| The interaction object. |
562
+ | Parameter | Type | Description |
563
+ | ------------- | -------------------------------------------------- | ----------------------- |
564
+ | `interaction` | {Discorb::MessageComponentInteraction::SelectMenu} | The interaction object. |
561
565
 
562
566
  #### `form_submit(interaction)`
563
567
 
564
568
  Fires when a form is submitted.
565
569
 
566
- | Parameter | Type | Description |
567
- | ---------- | ----- | ----------- |
570
+ | Parameter | Type | Description |
571
+ | ------------- | --------------------------- | ----------------------- |
568
572
  | `interaction` | {Discorb::ModalInteraction} | The interaction object. |
569
573
 
570
- #### `slash_command
571
-
572
574
  ### Voice events
573
575
 
574
576
  Because it's big, it's documented in {file:docs/voice_events.md}.
@@ -579,42 +581,74 @@ Because it's big, it's documented in {file:docs/voice_events.md}.
579
581
 
580
582
  Fires when a scheduled event is created.
581
583
 
582
- | Parameter | Type | Description |
583
- | ---------- | ----- | ----------- |
584
- | `event` | {Discorb::ScheduledEvent}| The created scheduled event. |
584
+ | Parameter | Type | Description |
585
+ | --------- | ------------------------- | ---------------------------- |
586
+ | `event` | {Discorb::ScheduledEvent} | The created scheduled event. |
585
587
 
586
588
  #### `scheduled_event_cancel(event)`, `scheduled_event_delete(event)`
587
589
 
588
590
  Fires when a scheduled event is canceled or deleted.
589
591
 
590
- | Parameter | Type | Description |
591
- | ---------- | ----- | ----------- |
592
- | `event` | {Discorb::ScheduledEvent}| The deleted scheduled event. |
592
+ | Parameter | Type | Description |
593
+ | --------- | ------------------------- | ---------------------------- |
594
+ | `event` | {Discorb::ScheduledEvent} | The deleted scheduled event. |
593
595
 
594
596
  #### `scheduled_event_edit(before, after)`
595
597
 
596
598
  Fires when a scheduled event is edited.
597
599
 
598
- | Parameter | Type | Description |
599
- | ---------- | ----- | ----------- |
600
- | `before` | {Discorb::ScheduledEvent}| The scheduled event before the edit. |
601
- | `after` | {Discorb::ScheduledEvent}| The scheduled event after the edit. |
600
+ | Parameter | Type | Description |
601
+ | --------- | ------------------------- | ------------------------------------ |
602
+ | `before` | {Discorb::ScheduledEvent} | The scheduled event before the edit. |
603
+ | `after` | {Discorb::ScheduledEvent} | The scheduled event after the edit. |
602
604
 
603
605
  #### `scheduled_event_start(event)`
604
606
 
605
607
  Fires when a scheduled event is started.
606
608
 
607
- | Parameter | Type | Description |
608
- | ---------- | ----- | ----------- |
609
- | `event` | {Discorb::ScheduledEvent}| The scheduled event that started. |
609
+ | Parameter | Type | Description |
610
+ | --------- | ------------------------- | --------------------------------- |
611
+ | `event` | {Discorb::ScheduledEvent} | The scheduled event that started. |
610
612
 
611
613
  #### `scheduled_event_end(event)`
612
614
 
613
615
  Fires when a scheduled event is ended.
614
616
 
615
- | Parameter | Type | Description |
616
- | ---------- | ----- | ----------- |
617
- | `event` | {Discorb::ScheduledEvent}| The scheduled event that ended. |
617
+ | Parameter | Type | Description |
618
+ | --------- | ------------------------- | ------------------------------- |
619
+ | `event` | {Discorb::ScheduledEvent} | The scheduled event that ended. |
620
+
621
+ ### Automod events
622
+
623
+ #### `auto_moderation_rule_create(rule)`
624
+
625
+ Fires when an auto moderation rule is created.
626
+
627
+ | Parameter | Type | Description |
628
+ | --------- | ---------------------- | --------------------------------- |
629
+ | `rule` | {Discorb::AutoModRule} | The created auto moderation rule. |
630
+
631
+ #### `auto_moderation_rule_update(rule)`
632
+
633
+ Fires when an auto moderation rule is updated.
634
+
635
+ | Parameter | Type | Description |
636
+ | --------- | ---------------------- | --------------------------------- |
637
+ | `rule` | {Discorb::AutoModRule} | The updated auto moderation rule. |
638
+
639
+ #### `auto_moderation_rule_delete(rule)`
640
+
641
+ Fires when an auto moderation rule is deleted.
642
+
643
+ | Parameter | Type | Description |
644
+ | --------- | ---------------------- | --------------------------------- |
645
+ | `rule` | {Discorb::AutoModRule} | The deleted auto moderation rule. |
646
+
647
+ #### `auto_moderation_action_execution(event)`
648
+
649
+ | Parameter | Type | Description |
650
+ | --------- | ------------------------------------------------------ | -------------------------- |
651
+ | `event` | {Discorb::Gateway::AutoModerationActionExecutionEvent} | The auto moderation event. |
618
652
 
619
653
  ### Low-level events
620
654
 
@@ -622,31 +656,31 @@ Fires when a scheduled event is ended.
622
656
 
623
657
  Fires when `GUILD_CREATE` is received.
624
658
 
625
- | Parameter | Type | Description |
626
- | ---------- | ----- | ----------- |
627
- |`guild` | {Discorb::Guild}| The guild of the event. |
659
+ | Parameter | Type | Description |
660
+ | --------- | ---------------- | ----------------------- |
661
+ | `guild` | {Discorb::Guild} | The guild of the event. |
628
662
 
629
663
  #### `guild_delete(guild)`
630
664
 
631
665
  Fires when `GUILD_DELETE` is received.
632
666
 
633
- | Parameter | Type | Description |
634
- | ---------- | ----- | ----------- |
635
- |`guild` | {Discorb::Guild}| The guild of the event. |
667
+ | Parameter | Type | Description |
668
+ | --------- | ---------------- | ----------------------- |
669
+ | `guild` | {Discorb::Guild} | The guild of the event. |
636
670
 
637
671
  #### `thread_create(thread)`
638
672
 
639
673
  Fires when `THREAD_CREATE` is received.
640
674
 
641
- | Parameter | Type | Description |
642
- | ---------- | ----- | ----------- |
643
- |`thread` | {Discorb::ThreadChannel}| The thread of the event. |
675
+ | Parameter | Type | Description |
676
+ | --------- | ------------------------ | ------------------------ |
677
+ | `thread` | {Discorb::ThreadChannel} | The thread of the event. |
644
678
 
645
679
  #### `scheduled_event_update(before, after)`
646
680
 
647
681
  Fires when `SCHEDULED_EVENT_UPDATE` is received.
648
682
 
649
- | Parameter | Type | Description |
650
- | ---------- | ----- | ----------- |
651
- | `before` | {Discorb::ScheduledEvent}| The scheduled event before the update. |
652
- |`after` | {Discorb::ScheduledEvent}| The scheduled event after the update. |
683
+ | Parameter | Type | Description |
684
+ | --------- | ------------------------- | -------------------------------------- |
685
+ | `before` | {Discorb::ScheduledEvent} | The scheduled event before the update. |
686
+ | `after` | {Discorb::ScheduledEvent} | The scheduled event after the update. |