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