lib_discord 1.0.1 → 1.1.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/lib/lib_discord/client.rb +2010 -758
- data/lib/lib_discord/version.rb +1 -1
- metadata +2 -2
data/lib/lib_discord/client.rb
CHANGED
@@ -80,104 +80,215 @@ module LibDiscord
|
|
80
80
|
# +URI.encode_www_form()+.
|
81
81
|
# @!macro [new] pBody
|
82
82
|
# @param body [#to_json] Request body
|
83
|
+
# @!macro [new] pReason
|
84
|
+
# @param reason [#to_s] A short message describing the purpose of this
|
85
|
+
# request, sent via the +X-Audit-Log-Reason+ header. If the given
|
86
|
+
# endpoint supports the Audit Log, Discord will enter the message into
|
87
|
+
# the server's audit log.
|
88
|
+
|
89
|
+
# @!macro [new] pAnswerID
|
90
|
+
# @param answer_id [#to_s] Answer ID
|
91
|
+
# @!macro [new] pApplicationID
|
92
|
+
# @param application_id [#to_s] Application ID
|
93
|
+
# @!macro [new] pAutoModerationRuleID
|
94
|
+
# @param auto_moderation_rule_id [#to_s] Auto Moderation Rule ID
|
95
|
+
# @!macro [new] pChannelID
|
96
|
+
# @param channel_id [#to_s] Channel ID
|
97
|
+
# @!macro [new] pCommandID
|
98
|
+
# @param command_id [#to_s] Command ID
|
99
|
+
# @!macro [new] pEmoji
|
100
|
+
# @param emoji [#to_s] Emoji
|
101
|
+
# @!macro [new] pEmojiID
|
102
|
+
# @param emoji_id [#to_s] Emoji ID
|
103
|
+
# @!macro [new] pEntitlementID
|
104
|
+
# @param entitlement_id [#to_s] Entitlement ID
|
105
|
+
# @!macro [new] pGuildID
|
106
|
+
# @param guild_id [#to_s] Guild ID
|
107
|
+
# @!macro [new] pGuildScheduledEventID
|
108
|
+
# @param guild_scheduled_event_id [#to_s] Guild Scheduled Event ID
|
109
|
+
# @!macro [new] pHttpPass
|
110
|
+
# @param pass [#to_s] HTTP basic authorization password
|
111
|
+
# @!macro [new] pHttpUser
|
112
|
+
# @param user [#to_s] HTTP basic authorization username
|
113
|
+
# @!macro [new] pInstanceID
|
114
|
+
# @param instance_id [#to_s] Activity Instance ID
|
115
|
+
# @!macro [new] pInviteCode
|
116
|
+
# @param invite_code [#to_s] Invite Code
|
117
|
+
# @!macro [new] pIntegrationID
|
118
|
+
# @param integration_id [#to_s] Integration ID
|
119
|
+
# @!macro [new] pInteractionID
|
120
|
+
# @param interaction_id [#to_s] Interaction ID
|
121
|
+
# @!macro [new] pInteractionToken
|
122
|
+
# @param interaction_token [#to_s] Interaction Token
|
123
|
+
# @!macro [new] pLobbyID
|
124
|
+
# @param lobby_id [#to_s] Lobby ID
|
125
|
+
# @!macro [new] pMessageID
|
126
|
+
# @param message_id [#to_s] Message ID
|
127
|
+
# @!macro [new] pOverwriteID
|
128
|
+
# @param overwrite_id [#to_s] Overwrite ID
|
129
|
+
# @!macro [new] pRoleID
|
130
|
+
# @param role_id [#to_s] Role ID
|
131
|
+
# @!macro [new] pSkuID
|
132
|
+
# @param sku_id [#to_s] SKU ID
|
133
|
+
# @!macro [new] pSoundID
|
134
|
+
# @param sound_id [#to_s] Sound ID
|
135
|
+
# @!macro [new] pStickerID
|
136
|
+
# @param sticker_id [#to_s] Sticker ID
|
137
|
+
# @!macro [new] pStickerPackID
|
138
|
+
# @param sticker_id [#to_s] Sticker Pack ID
|
139
|
+
# @!macro [new] pSubscriptionID
|
140
|
+
# @param subscription_id [#to_s] Subscription ID
|
141
|
+
# @!macro [new] pTemplateCode
|
142
|
+
# @param template_code [#to_s] Template Code
|
143
|
+
# @!macro [new] pUserID
|
144
|
+
# @param user_id [#to_s] User ID
|
145
|
+
# @!macro [new] pWebhookID
|
146
|
+
# @param webhook_id [#to_s] Webhook ID
|
147
|
+
# @!macro [new] pWebhookToken
|
148
|
+
# @param webhook_token [#to_s] Webhook Token
|
149
|
+
|
83
150
|
# @!macro [new] rResponse
|
84
151
|
# @return [Response]
|
85
152
|
|
86
153
|
### Interaction {{{
|
87
154
|
|
88
155
|
##
|
89
|
-
# @
|
90
|
-
# @
|
156
|
+
# @macro pInteractionID
|
157
|
+
# @macro pInteractionToken
|
91
158
|
# @macro pBody
|
159
|
+
# @macro pReason
|
92
160
|
# @macro rResponse
|
93
161
|
#
|
94
162
|
# @see https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response
|
95
163
|
# Discord documentation "Create Interaction Response"
|
96
|
-
def create_interaction_response(interaction_id, interaction_token, body)
|
97
|
-
json_request(
|
164
|
+
def create_interaction_response(interaction_id, interaction_token, body, reason: nil)
|
165
|
+
json_request(
|
166
|
+
:post,
|
167
|
+
discord("/interactions/#{interaction_id}/#{interaction_token}/callback"),
|
168
|
+
body:,
|
169
|
+
headers: auditlog(reason)
|
170
|
+
)
|
98
171
|
end
|
99
172
|
|
100
173
|
##
|
101
|
-
# @
|
102
|
-
# @
|
174
|
+
# @macro pApplicationID
|
175
|
+
# @macro pInteractionToken
|
176
|
+
# @macro pReason
|
103
177
|
# @macro rResponse
|
104
178
|
#
|
105
179
|
# @see https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response
|
106
180
|
# Discord documentation "Get Original Interaction Response"
|
107
|
-
def get_original_interaction_response(application_id, interaction_token)
|
108
|
-
json_request(
|
181
|
+
def get_original_interaction_response(application_id, interaction_token, reason: nil)
|
182
|
+
json_request(
|
183
|
+
:get,
|
184
|
+
discord("/webhooks/#{application_id}/#{interaction_token}/messages/@original"),
|
185
|
+
headers: auditlog(reason)
|
186
|
+
)
|
109
187
|
end
|
110
188
|
|
111
189
|
##
|
112
|
-
# @
|
113
|
-
# @
|
190
|
+
# @macro pApplicationID
|
191
|
+
# @macro pInteractionToken
|
114
192
|
# @macro pBody
|
193
|
+
# @macro pReason
|
115
194
|
# @macro rResponse
|
116
195
|
#
|
117
196
|
# @see https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response
|
118
197
|
# Discord documentation "Edit Original Interaction Response"
|
119
|
-
def edit_original_interaction_response(application_id, interaction_token, body)
|
120
|
-
json_request(
|
198
|
+
def edit_original_interaction_response(application_id, interaction_token, body, reason: nil)
|
199
|
+
json_request(
|
200
|
+
:patch,
|
201
|
+
discord("/webhooks/#{application_id}/#{interaction_token}/messages/@original"),
|
202
|
+
body:,
|
203
|
+
headers: auditlog(reason)
|
204
|
+
)
|
121
205
|
end
|
122
206
|
|
123
207
|
##
|
124
|
-
# @
|
125
|
-
# @
|
208
|
+
# @macro pApplicationID
|
209
|
+
# @macro pInteractionToken
|
210
|
+
# @macro pReason
|
126
211
|
# @macro rResponse
|
127
212
|
#
|
128
213
|
# @see https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response
|
129
214
|
# Discord documentation "Delete Original Interaction Response"
|
130
|
-
def delete_original_interaction_response(application_id, interaction_token)
|
131
|
-
json_request(
|
215
|
+
def delete_original_interaction_response(application_id, interaction_token, reason: nil)
|
216
|
+
json_request(
|
217
|
+
:delete,
|
218
|
+
discord("/webhooks/#{application_id}/#{interaction_token}/messages/@original"),
|
219
|
+
headers: auditlog(reason)
|
220
|
+
)
|
132
221
|
end
|
133
222
|
|
134
223
|
##
|
135
|
-
# @
|
136
|
-
# @
|
224
|
+
# @macro pApplicationID
|
225
|
+
# @macro pInteractionToken
|
137
226
|
# @macro pBody
|
227
|
+
# @macro pReason
|
138
228
|
# @macro rResponse
|
139
229
|
#
|
140
230
|
# @see https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message
|
141
231
|
# Discord documentation "Create Followup Message"
|
142
|
-
def create_followup_message(application_id, interaction_token, body)
|
143
|
-
json_request(
|
232
|
+
def create_followup_message(application_id, interaction_token, body, reason: nil)
|
233
|
+
json_request(
|
234
|
+
:post,
|
235
|
+
discord("/webhooks/#{application_id}/#{interaction_token}"),
|
236
|
+
body:,
|
237
|
+
headers: auditlog(reason)
|
238
|
+
)
|
144
239
|
end
|
145
240
|
|
146
241
|
##
|
147
|
-
# @
|
148
|
-
# @
|
149
|
-
# @
|
242
|
+
# @macro pApplicationID
|
243
|
+
# @macro pInteractionToken
|
244
|
+
# @macro pMessageID
|
245
|
+
# @macro pReason
|
150
246
|
# @macro rResponse
|
151
247
|
#
|
152
248
|
# @see https://discord.com/developers/docs/interactions/receiving-and-responding#get-followup-message
|
153
249
|
# Discord documentation "Get Followup Message"
|
154
|
-
def get_followup_message(application_id, interaction_token, message_id)
|
155
|
-
json_request(
|
250
|
+
def get_followup_message(application_id, interaction_token, message_id, reason: nil)
|
251
|
+
json_request(
|
252
|
+
:get,
|
253
|
+
discord("/webhooks/#{application_id}/#{interaction_token}/messages/#{message_id}"),
|
254
|
+
headers: auditlog(reason)
|
255
|
+
)
|
156
256
|
end
|
157
257
|
|
158
258
|
##
|
159
|
-
# @
|
160
|
-
# @
|
161
|
-
# @
|
259
|
+
# @macro pApplicationID
|
260
|
+
# @macro pInteractionToken
|
261
|
+
# @macro pMessageID
|
162
262
|
# @macro pBody
|
263
|
+
# @macro pReason
|
163
264
|
# @macro rResponse
|
164
265
|
#
|
165
266
|
# @see https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message
|
166
267
|
# Discord documentation "Edit Followup Message"
|
167
|
-
def edit_followup_message(application_id, interaction_token, message_id, body)
|
168
|
-
json_request(
|
268
|
+
def edit_followup_message(application_id, interaction_token, message_id, body, reason: nil)
|
269
|
+
json_request(
|
270
|
+
:patch,
|
271
|
+
discord("/webhooks/#{application_id}/#{interaction_token}/messages/#{message_id}"),
|
272
|
+
body:,
|
273
|
+
headers: auditlog(reason)
|
274
|
+
)
|
169
275
|
end
|
170
276
|
|
171
277
|
##
|
172
|
-
# @
|
173
|
-
# @
|
174
|
-
# @
|
278
|
+
# @macro pApplicationID
|
279
|
+
# @macro pInteractionToken
|
280
|
+
# @macro pMessageID
|
281
|
+
# @macro pReason
|
175
282
|
# @macro rResponse
|
176
283
|
#
|
177
284
|
# @see https://discord.com/developers/docs/interactions/receiving-and-responding#delete-followup-message
|
178
285
|
# Discord documentation "Delete Followup Message"
|
179
|
-
def delete_followup_message(application_id, interaction_token, message_id)
|
180
|
-
json_request(
|
286
|
+
def delete_followup_message(application_id, interaction_token, message_id, reason: nil)
|
287
|
+
json_request(
|
288
|
+
:delete,
|
289
|
+
discord("/webhooks/#{application_id}/#{interaction_token}/messages/#{message_id}"),
|
290
|
+
headers: auditlog(reason)
|
291
|
+
)
|
181
292
|
end
|
182
293
|
|
183
294
|
### }}} Interaction
|
@@ -185,179 +296,263 @@ module LibDiscord
|
|
185
296
|
### Application Command {{{
|
186
297
|
|
187
298
|
##
|
188
|
-
# @
|
299
|
+
# @macro pApplicationID
|
189
300
|
# @macro pQuery
|
301
|
+
# @macro pReason
|
190
302
|
# @macro rResponse
|
191
303
|
#
|
192
304
|
# @see https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands
|
193
305
|
# Discord documentation "Get Global Application Commands"
|
194
|
-
def get_global_application_commands(application_id, query = {})
|
195
|
-
json_request(
|
306
|
+
def get_global_application_commands(application_id, query = {}, reason: nil)
|
307
|
+
json_request(
|
308
|
+
:get,
|
309
|
+
discord("/applications/#{application_id}/commands"),
|
310
|
+
query:,
|
311
|
+
headers: auditlog(reason)
|
312
|
+
)
|
196
313
|
end
|
197
314
|
|
198
315
|
##
|
199
|
-
# @
|
316
|
+
# @macro pApplicationID
|
200
317
|
# @macro pBody
|
318
|
+
# @macro pReason
|
201
319
|
# @macro rResponse
|
202
320
|
#
|
203
321
|
# @see https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
|
204
322
|
# Discord documentation "Create Global Application Command"
|
205
|
-
def create_global_application_command(application_id, body)
|
206
|
-
json_request(
|
323
|
+
def create_global_application_command(application_id, body, reason: nil)
|
324
|
+
json_request(
|
325
|
+
:post,
|
326
|
+
discord("/applications/#{application_id}/commands"),
|
327
|
+
body:,
|
328
|
+
headers: auditlog(reason)
|
329
|
+
)
|
207
330
|
end
|
208
331
|
|
209
332
|
##
|
210
|
-
# @
|
211
|
-
# @
|
333
|
+
# @macro pApplicationID
|
334
|
+
# @macro pCommandID
|
335
|
+
# @macro pReason
|
212
336
|
# @macro rResponse
|
213
337
|
#
|
214
338
|
# @see https://discord.com/developers/docs/interactions/application-commands#get-global-application-command
|
215
339
|
# Discord documentation "Get Global Application Command"
|
216
|
-
def get_global_application_command(application_id, command_id)
|
217
|
-
json_request(
|
340
|
+
def get_global_application_command(application_id, command_id, reason: nil)
|
341
|
+
json_request(
|
342
|
+
:get,
|
343
|
+
discord("/applications/#{application_id}/commands/#{command_id}"),
|
344
|
+
headers: auditlog(reason)
|
345
|
+
)
|
218
346
|
end
|
219
347
|
|
220
348
|
##
|
221
|
-
# @
|
222
|
-
# @
|
349
|
+
# @macro pApplicationID
|
350
|
+
# @macro pCommandID
|
223
351
|
# @macro pBody
|
352
|
+
# @macro pReason
|
224
353
|
# @macro rResponse
|
225
354
|
#
|
226
355
|
# @see https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command
|
227
356
|
# Discord documentation "Edit Global Application Command"
|
228
|
-
def edit_global_application_command(application_id, command_id, body)
|
229
|
-
json_request(
|
357
|
+
def edit_global_application_command(application_id, command_id, body, reason: nil)
|
358
|
+
json_request(
|
359
|
+
:patch,
|
360
|
+
discord("/applications/#{application_id}/commands/#{command_id}"),
|
361
|
+
body:,
|
362
|
+
headers: auditlog(reason)
|
363
|
+
)
|
230
364
|
end
|
231
365
|
|
232
366
|
##
|
233
|
-
# @
|
234
|
-
# @
|
367
|
+
# @macro pApplicationID
|
368
|
+
# @macro pCommandID
|
369
|
+
# @macro pReason
|
235
370
|
# @macro rResponse
|
236
371
|
#
|
237
372
|
# @see https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command
|
238
373
|
# Discord documentation "Delete Global Application Command"
|
239
|
-
def delete_global_application_command(application_id, command_id)
|
240
|
-
json_request(
|
374
|
+
def delete_global_application_command(application_id, command_id, reason: nil)
|
375
|
+
json_request(
|
376
|
+
:delete,
|
377
|
+
discord("/applications/#{application_id}/commands/#{command_id}"),
|
378
|
+
headers: auditlog(reason)
|
379
|
+
)
|
241
380
|
end
|
242
381
|
|
243
382
|
##
|
244
|
-
# @
|
383
|
+
# @macro pApplicationID
|
245
384
|
# @macro pBody
|
385
|
+
# @macro pReason
|
246
386
|
# @macro rResponse
|
247
387
|
#
|
248
388
|
# @see https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands
|
249
389
|
# Discord documentation "Bulk Overwrite Global Application Commands"
|
250
|
-
def bulk_overwrite_global_application_commands(application_id, body)
|
251
|
-
json_request(
|
390
|
+
def bulk_overwrite_global_application_commands(application_id, body, reason: nil)
|
391
|
+
json_request(
|
392
|
+
:put,
|
393
|
+
discord("/applications/#{application_id}/commands"),
|
394
|
+
body:,
|
395
|
+
headers: auditlog(reason)
|
396
|
+
)
|
252
397
|
end
|
253
398
|
|
254
399
|
##
|
255
|
-
# @
|
256
|
-
# @
|
400
|
+
# @macro pApplicationID
|
401
|
+
# @macro pGuildID
|
257
402
|
# @macro pQuery
|
403
|
+
# @macro pReason
|
258
404
|
# @macro rResponse
|
259
405
|
#
|
260
406
|
# @see https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands
|
261
407
|
# Discord documentation "Get Guild Application Commands"
|
262
|
-
def get_guild_application_commands(application_id, guild_id, query = {})
|
263
|
-
json_request(
|
408
|
+
def get_guild_application_commands(application_id, guild_id, query = {}, reason: nil)
|
409
|
+
json_request(
|
410
|
+
:get,
|
411
|
+
discord("/applications/#{application_id}/guilds/#{guild_id}/commands"),
|
412
|
+
query:,
|
413
|
+
headers: auditlog(reason)
|
414
|
+
)
|
264
415
|
end
|
265
416
|
|
266
417
|
##
|
267
|
-
# @
|
268
|
-
# @
|
418
|
+
# @macro pApplicationID
|
419
|
+
# @macro pGuildID
|
269
420
|
# @macro pBody
|
421
|
+
# @macro pReason
|
270
422
|
# @macro rResponse
|
271
423
|
#
|
272
424
|
# @see https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command
|
273
425
|
# Discord documentation "Create Guild Application Command"
|
274
|
-
def create_guild_application_command(application_id, guild_id, body)
|
275
|
-
json_request(
|
426
|
+
def create_guild_application_command(application_id, guild_id, body, reason: nil)
|
427
|
+
json_request(
|
428
|
+
:post,
|
429
|
+
discord("/applications/#{application_id}/guilds/#{guild_id}/commands"),
|
430
|
+
body:,
|
431
|
+
headers: auditlog(reason)
|
432
|
+
)
|
276
433
|
end
|
277
434
|
|
278
435
|
##
|
279
|
-
# @
|
280
|
-
# @
|
281
|
-
# @
|
436
|
+
# @macro pApplicationID
|
437
|
+
# @macro pGuildID
|
438
|
+
# @macro pCommandID
|
439
|
+
# @macro pReason
|
282
440
|
# @macro rResponse
|
283
441
|
#
|
284
442
|
# @see https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command
|
285
443
|
# Discord documentation "Get Guild Application Command"
|
286
|
-
def get_guild_application_command(application_id, guild_id, command_id)
|
287
|
-
json_request(
|
444
|
+
def get_guild_application_command(application_id, guild_id, command_id, reason: nil)
|
445
|
+
json_request(
|
446
|
+
:get,
|
447
|
+
discord("/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}"),
|
448
|
+
headers: auditlog(reason)
|
449
|
+
)
|
288
450
|
end
|
289
451
|
|
290
452
|
##
|
291
|
-
# @
|
292
|
-
# @
|
293
|
-
# @
|
453
|
+
# @macro pApplicationID
|
454
|
+
# @macro pGuildID
|
455
|
+
# @macro pCommandID
|
294
456
|
# @macro pBody
|
457
|
+
# @macro pReason
|
295
458
|
# @macro rResponse
|
296
459
|
#
|
297
460
|
# @see https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command
|
298
461
|
# Discord documentation "Edit Guild Application Command"
|
299
|
-
def edit_guild_application_command(application_id, guild_id, command_id, body)
|
300
|
-
json_request(
|
462
|
+
def edit_guild_application_command(application_id, guild_id, command_id, body, reason: nil)
|
463
|
+
json_request(
|
464
|
+
:patch,
|
465
|
+
discord("/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}"),
|
466
|
+
body:,
|
467
|
+
headers: auditlog(reason)
|
468
|
+
)
|
301
469
|
end
|
302
470
|
|
303
471
|
##
|
304
|
-
# @
|
305
|
-
# @
|
306
|
-
# @
|
472
|
+
# @macro pApplicationID
|
473
|
+
# @macro pGuildID
|
474
|
+
# @macro pCommandID
|
475
|
+
# @macro pReason
|
307
476
|
# @macro rResponse
|
308
477
|
#
|
309
478
|
# @see https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command
|
310
479
|
# Discord documentation "Delete Guild Application Command"
|
311
|
-
def delete_guild_application_command(application_id, guild_id, command_id)
|
312
|
-
json_request(
|
480
|
+
def delete_guild_application_command(application_id, guild_id, command_id, reason: nil)
|
481
|
+
json_request(
|
482
|
+
:delete,
|
483
|
+
discord("/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}"),
|
484
|
+
headers: auditlog(reason)
|
485
|
+
)
|
313
486
|
end
|
314
487
|
|
315
488
|
##
|
316
|
-
# @
|
317
|
-
# @
|
489
|
+
# @macro pApplicationID
|
490
|
+
# @macro pGuildID
|
318
491
|
# @macro pBody
|
492
|
+
# @macro pReason
|
319
493
|
# @macro rResponse
|
320
494
|
#
|
321
495
|
# @see https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands
|
322
496
|
# Discord documentation "Bulk Overwrite Guild Application Commands"
|
323
|
-
def bulk_overwrite_guild_application_commands(application_id, guild_id, body)
|
324
|
-
json_request(
|
497
|
+
def bulk_overwrite_guild_application_commands(application_id, guild_id, body, reason: nil)
|
498
|
+
json_request(
|
499
|
+
:put,
|
500
|
+
discord("/applications/#{application_id}/guilds/#{guild_id}/commands"),
|
501
|
+
body:,
|
502
|
+
headers: auditlog(reason)
|
503
|
+
)
|
325
504
|
end
|
326
505
|
|
327
506
|
##
|
328
|
-
# @
|
329
|
-
# @
|
507
|
+
# @macro pApplicationID
|
508
|
+
# @macro pGuildID
|
509
|
+
# @macro pReason
|
330
510
|
# @macro rResponse
|
331
511
|
#
|
332
512
|
# @see https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions
|
333
513
|
# Discord documentation "Get Guild Application Command Permissions"
|
334
|
-
def get_guild_application_command_permissions(application_id, guild_id)
|
335
|
-
json_request(
|
514
|
+
def get_guild_application_command_permissions(application_id, guild_id, reason: nil)
|
515
|
+
json_request(
|
516
|
+
:get,
|
517
|
+
discord("/applications/#{application_id}/guilds/#{guild_id}/commands/permissions"),
|
518
|
+
headers: auditlog(reason)
|
519
|
+
)
|
336
520
|
end
|
337
521
|
|
338
522
|
##
|
339
|
-
# @
|
340
|
-
# @
|
341
|
-
# @
|
523
|
+
# @macro pApplicationID
|
524
|
+
# @macro pGuildID
|
525
|
+
# @macro pCommandID
|
526
|
+
# @macro pReason
|
342
527
|
# @macro rResponse
|
343
528
|
#
|
344
529
|
# @see https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions
|
345
530
|
# Discord documentation "Get Application Command Permissions"
|
346
|
-
def get_application_command_permissions(application_id, guild_id, command_id)
|
347
|
-
json_request(
|
531
|
+
def get_application_command_permissions(application_id, guild_id, command_id, reason: nil)
|
532
|
+
json_request(
|
533
|
+
:get,
|
534
|
+
discord("/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}/permissions"),
|
535
|
+
headers: auditlog(reason)
|
536
|
+
)
|
348
537
|
end
|
349
538
|
|
350
539
|
##
|
351
|
-
# @
|
352
|
-
# @
|
353
|
-
# @
|
540
|
+
# @macro pApplicationID
|
541
|
+
# @macro pGuildID
|
542
|
+
# @macro pCommandID
|
354
543
|
# @macro pBody
|
544
|
+
# @macro pReason
|
355
545
|
# @macro rResponse
|
356
546
|
#
|
357
547
|
# @see https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions
|
358
548
|
# Discord documentation "Edit Application Command Permissions"
|
359
|
-
def edit_application_command_permissions(application_id, guild_id, command_id, body)
|
360
|
-
json_request(
|
549
|
+
def edit_application_command_permissions(application_id, guild_id, command_id, body, reason: nil)
|
550
|
+
json_request(
|
551
|
+
:put,
|
552
|
+
discord("/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}/permissions"),
|
553
|
+
body:,
|
554
|
+
headers: auditlog(reason)
|
555
|
+
)
|
361
556
|
end
|
362
557
|
|
363
558
|
##
|
@@ -368,15 +563,21 @@ module LibDiscord
|
|
368
563
|
# permissions} (though you should be careful to handle any potential
|
369
564
|
# {https://discord.com/developers/docs/topics/rate-limits rate limits}).
|
370
565
|
#
|
371
|
-
# @
|
372
|
-
# @
|
566
|
+
# @macro pApplicationID
|
567
|
+
# @macro pGuildID
|
373
568
|
# @macro pBody
|
569
|
+
# @macro pReason
|
374
570
|
# @macro rResponse
|
375
571
|
#
|
376
572
|
# @see https://discord.com/developers/docs/interactions/application-commands#batch-edit-application-command-permissions
|
377
573
|
# Discord documentation "Batch Edit Application Command Permissions"
|
378
|
-
def batch_edit_application_command_permissions(application_id, guild_id, body)
|
379
|
-
json_request(
|
574
|
+
def batch_edit_application_command_permissions(application_id, guild_id, body, reason: nil)
|
575
|
+
json_request(
|
576
|
+
:put,
|
577
|
+
discord("/applications/#{application_id}/guilds/#{guild_id}/commands/permissions"),
|
578
|
+
body:,
|
579
|
+
headers: auditlog(reason)
|
580
|
+
)
|
380
581
|
end
|
381
582
|
|
382
583
|
### }}} Application Command
|
@@ -384,21 +585,23 @@ module LibDiscord
|
|
384
585
|
### Gateway {{{
|
385
586
|
|
386
587
|
##
|
588
|
+
# @macro pReason
|
387
589
|
# @macro rResponse
|
388
590
|
#
|
389
591
|
# @see https://discord.com/developers/docs/events/gateway#get-gateway
|
390
592
|
# Discord documentation "Get Gateway"
|
391
|
-
def get_gateway
|
392
|
-
json_request(:get, discord("/gateway"))
|
593
|
+
def get_gateway(reason: nil)
|
594
|
+
json_request(:get, discord("/gateway"), headers: auditlog(reason))
|
393
595
|
end
|
394
596
|
|
395
597
|
##
|
598
|
+
# @macro pReason
|
396
599
|
# @macro rResponse
|
397
600
|
#
|
398
601
|
# @see https://discord.com/developers/docs/events/gateway#get-gateway-bot
|
399
602
|
# Discord documentation "Get Gateway Bot"
|
400
|
-
def get_gateway_bot
|
401
|
-
json_request(:get, discord("/gateway/bot"))
|
603
|
+
def get_gateway_bot(reason: nil)
|
604
|
+
json_request(:get, discord("/gateway/bot"), headers: auditlog(reason))
|
402
605
|
end
|
403
606
|
|
404
607
|
### }}} Gateway
|
@@ -406,26 +609,37 @@ module LibDiscord
|
|
406
609
|
### Application Role Connection Metadata {{{
|
407
610
|
|
408
611
|
##
|
409
|
-
# @
|
612
|
+
# @macro pApplicationID
|
613
|
+
# @macro pReason
|
410
614
|
# @macro rResponse
|
411
615
|
#
|
412
616
|
# @see https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
|
413
617
|
# Discord documentation "Get Application Role Connection Metadata
|
414
618
|
# Records"
|
415
|
-
def get_application_role_connection_metadata_records(application_id)
|
416
|
-
json_request(
|
619
|
+
def get_application_role_connection_metadata_records(application_id, reason: nil)
|
620
|
+
json_request(
|
621
|
+
:get,
|
622
|
+
discord("/applications/#{application_id}/role-connections/metadata"),
|
623
|
+
headers: auditlog(reason)
|
624
|
+
)
|
417
625
|
end
|
418
626
|
|
419
627
|
##
|
420
|
-
# @
|
628
|
+
# @macro pApplicationID
|
421
629
|
# @macro pBody
|
630
|
+
# @macro pReason
|
422
631
|
# @macro rResponse
|
423
632
|
#
|
424
633
|
# @see https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
|
425
634
|
# Discord documentation "Update Application Role Connection Metadata
|
426
635
|
# Records"
|
427
|
-
def update_application_role_connection_metadata_records(application_id, body)
|
428
|
-
json_request(
|
636
|
+
def update_application_role_connection_metadata_records(application_id, body, reason: nil)
|
637
|
+
json_request(
|
638
|
+
:put,
|
639
|
+
discord("/applications/#{application_id}/role-connections/metadata"),
|
640
|
+
body:,
|
641
|
+
headers: auditlog(reason)
|
642
|
+
)
|
429
643
|
end
|
430
644
|
|
431
645
|
### }}} Application Role Connection Metadata
|
@@ -433,33 +647,45 @@ module LibDiscord
|
|
433
647
|
### Application {{{
|
434
648
|
|
435
649
|
##
|
650
|
+
# @macro pReason
|
436
651
|
# @macro rResponse
|
437
652
|
#
|
438
653
|
# @see https://discord.com/developers/docs/resources/application#get-current-application
|
439
654
|
# Discord documentation "Get Current Application"
|
440
|
-
def get_current_application
|
441
|
-
json_request(:get, discord("/applications/@me"))
|
655
|
+
def get_current_application(reason: nil)
|
656
|
+
json_request(:get, discord("/applications/@me"), headers: auditlog(reason))
|
442
657
|
end
|
443
658
|
|
444
659
|
##
|
445
660
|
# @macro pBody
|
661
|
+
# @macro pReason
|
446
662
|
# @macro rResponse
|
447
663
|
#
|
448
664
|
# @see https://discord.com/developers/docs/resources/application#edit-current-application
|
449
665
|
# Discord documentation "Edit Current Application"
|
450
|
-
def edit_current_application(body)
|
451
|
-
json_request(
|
666
|
+
def edit_current_application(body, reason: nil)
|
667
|
+
json_request(
|
668
|
+
:patch,
|
669
|
+
discord("/applications/@me"),
|
670
|
+
body:,
|
671
|
+
headers: auditlog(reason)
|
672
|
+
)
|
452
673
|
end
|
453
674
|
|
454
675
|
##
|
455
|
-
# @
|
456
|
-
# @
|
676
|
+
# @macro pApplicationID
|
677
|
+
# @macro pInstanceID
|
678
|
+
# @macro pReason
|
457
679
|
# @macro rResponse
|
458
680
|
#
|
459
681
|
# @see https://discord.com/developers/docs/resources/application#get-application-activity-instance
|
460
682
|
# Discord documentation "Get Application Activity Instance"
|
461
|
-
def get_application_activity_instance(application_id, instance_id)
|
462
|
-
json_request(
|
683
|
+
def get_application_activity_instance(application_id, instance_id, reason: nil)
|
684
|
+
json_request(
|
685
|
+
:get,
|
686
|
+
discord("/applications/#{application_id}/activity-instances/#{instance_id}"),
|
687
|
+
headers: auditlog(reason)
|
688
|
+
)
|
463
689
|
end
|
464
690
|
|
465
691
|
### }}} Application
|
@@ -467,14 +693,20 @@ module LibDiscord
|
|
467
693
|
### Audit Log {{{
|
468
694
|
|
469
695
|
##
|
470
|
-
# @
|
696
|
+
# @macro pGuildID
|
471
697
|
# @macro pQuery
|
698
|
+
# @macro pReason
|
472
699
|
# @macro rResponse
|
473
700
|
#
|
474
701
|
# @see https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log
|
475
702
|
# Discord documentation "Get Guild Audit Log"
|
476
|
-
def get_guild_audit_log(guild_id, query = {})
|
477
|
-
json_request(
|
703
|
+
def get_guild_audit_log(guild_id, query = {}, reason: nil)
|
704
|
+
json_request(
|
705
|
+
:get,
|
706
|
+
discord("/guilds/#{guild_id}/audit-logs"),
|
707
|
+
query:,
|
708
|
+
headers: auditlog(reason)
|
709
|
+
)
|
478
710
|
end
|
479
711
|
|
480
712
|
### }}} Audit Log
|
@@ -482,58 +714,85 @@ module LibDiscord
|
|
482
714
|
### Auto Moderation {{{
|
483
715
|
|
484
716
|
##
|
485
|
-
# @
|
717
|
+
# @macro pGuildID
|
718
|
+
# @macro pReason
|
486
719
|
# @macro rResponse
|
487
720
|
#
|
488
721
|
# @see https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild
|
489
722
|
# Discord documentation "List Auto Moderation Rules for Guild"
|
490
|
-
def list_auto_moderation_rules_for_guild(guild_id)
|
491
|
-
json_request(
|
723
|
+
def list_auto_moderation_rules_for_guild(guild_id, reason: nil)
|
724
|
+
json_request(
|
725
|
+
:get,
|
726
|
+
discord("/guilds/#{guild_id}/auto-moderation/rules"),
|
727
|
+
headers: auditlog(reason)
|
728
|
+
)
|
492
729
|
end
|
493
730
|
|
494
731
|
##
|
495
|
-
# @
|
496
|
-
# @
|
732
|
+
# @macro pGuildID
|
733
|
+
# @macro pAutoModerationRuleID
|
734
|
+
# @macro pReason
|
497
735
|
# @macro rResponse
|
498
736
|
#
|
499
737
|
# @see https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule
|
500
738
|
# Discord documentation "Get Auto Moderation Rule"
|
501
|
-
def get_auto_moderation_rule(guild_id, auto_moderation_rule_id)
|
502
|
-
json_request(
|
739
|
+
def get_auto_moderation_rule(guild_id, auto_moderation_rule_id, reason: nil)
|
740
|
+
json_request(
|
741
|
+
:get,
|
742
|
+
discord("/guilds/#{guild_id}/auto-moderation/rules/#{auto_moderation_rule_id}"),
|
743
|
+
headers: auditlog(reason)
|
744
|
+
)
|
503
745
|
end
|
504
746
|
|
505
747
|
##
|
506
|
-
# @
|
748
|
+
# @macro pGuildID
|
507
749
|
# @macro pBody
|
750
|
+
# @macro pReason
|
508
751
|
# @macro rResponse
|
509
752
|
#
|
510
753
|
# @see https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
|
511
754
|
# Discord documentation "Create Auto Moderation Rule"
|
512
|
-
def create_auto_moderation_rule(guild_id, body)
|
513
|
-
json_request(
|
755
|
+
def create_auto_moderation_rule(guild_id, body, reason: nil)
|
756
|
+
json_request(
|
757
|
+
:post,
|
758
|
+
discord("/guilds/#{guild_id}/auto-moderation/rules"),
|
759
|
+
body:,
|
760
|
+
headers: auditlog(reason)
|
761
|
+
)
|
514
762
|
end
|
515
763
|
|
516
764
|
##
|
517
|
-
# @
|
518
|
-
# @
|
765
|
+
# @macro pGuildID
|
766
|
+
# @macro pAutoModerationRuleID
|
519
767
|
# @macro pBody
|
768
|
+
# @macro pReason
|
520
769
|
# @macro rResponse
|
521
770
|
#
|
522
771
|
# @see https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule
|
523
772
|
# Discord documentation "Modify Auto Moderation Rule"
|
524
|
-
def modify_auto_moderation_rule(guild_id, auto_moderation_rule_id, body)
|
525
|
-
json_request(
|
773
|
+
def modify_auto_moderation_rule(guild_id, auto_moderation_rule_id, body, reason: nil)
|
774
|
+
json_request(
|
775
|
+
:patch,
|
776
|
+
discord("/guilds/#{guild_id}/auto-moderation/rules/#{auto_moderation_rule_id}"),
|
777
|
+
body:,
|
778
|
+
headers: auditlog(reason)
|
779
|
+
)
|
526
780
|
end
|
527
781
|
|
528
782
|
##
|
529
|
-
# @
|
530
|
-
# @
|
783
|
+
# @macro pGuildID
|
784
|
+
# @macro pAutoModerationRuleID
|
785
|
+
# @macro pReason
|
531
786
|
# @macro rResponse
|
532
787
|
#
|
533
788
|
# @see https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule
|
534
789
|
# Discord documentation "Delete Auto Moderation Rule"
|
535
|
-
def delete_auto_moderation_rule(guild_id, auto_moderation_rule_id)
|
536
|
-
json_request(
|
790
|
+
def delete_auto_moderation_rule(guild_id, auto_moderation_rule_id, reason: nil)
|
791
|
+
json_request(
|
792
|
+
:delete,
|
793
|
+
discord("/guilds/#{guild_id}/auto-moderation/rules/#{auto_moderation_rule_id}"),
|
794
|
+
headers: auditlog(reason)
|
795
|
+
)
|
537
796
|
end
|
538
797
|
|
539
798
|
### }}} Auto Moderation
|
@@ -541,290 +800,431 @@ module LibDiscord
|
|
541
800
|
### Channel {{{
|
542
801
|
|
543
802
|
##
|
544
|
-
# @
|
803
|
+
# @macro pChannelID
|
804
|
+
# @macro pReason
|
545
805
|
# @macro rResponse
|
546
806
|
#
|
547
807
|
# @see https://discord.com/developers/docs/resources/channel#get-channel
|
548
808
|
# Discord documentation "Get Channel"
|
549
|
-
def get_channel(channel_id)
|
550
|
-
json_request(
|
809
|
+
def get_channel(channel_id, reason: nil)
|
810
|
+
json_request(
|
811
|
+
:get,
|
812
|
+
discord("/channels/#{channel_id}"),
|
813
|
+
headers: auditlog(reason)
|
814
|
+
)
|
551
815
|
end
|
552
816
|
|
553
817
|
##
|
554
|
-
# @
|
818
|
+
# @macro pChannelID
|
555
819
|
# @macro pBody
|
820
|
+
# @macro pReason
|
556
821
|
# @macro rResponse
|
557
822
|
#
|
558
823
|
# @see https://discord.com/developers/docs/resources/channel#modify-channel
|
559
824
|
# Discord documentation "Modify Channel"
|
560
|
-
def modify_channel(channel_id, body)
|
561
|
-
json_request(
|
825
|
+
def modify_channel(channel_id, body, reason: nil)
|
826
|
+
json_request(
|
827
|
+
:patch,
|
828
|
+
discord("/channels/#{channel_id}"),
|
829
|
+
body:,
|
830
|
+
headers: auditlog(reason)
|
831
|
+
)
|
562
832
|
end
|
563
833
|
|
564
834
|
##
|
565
|
-
# @
|
835
|
+
# @macro pChannelID
|
836
|
+
# @macro pReason
|
566
837
|
# @macro rResponse
|
567
838
|
#
|
568
839
|
# @see https://discord.com/developers/docs/resources/channel#deleteclose-channel
|
569
840
|
# Discord documentation "Delete/Close Channel"
|
570
|
-
def delete_channel(channel_id)
|
571
|
-
json_request(
|
841
|
+
def delete_channel(channel_id, reason: nil)
|
842
|
+
json_request(
|
843
|
+
:delete,
|
844
|
+
discord("/channels/#{channel_id}"),
|
845
|
+
headers: auditlog(reason)
|
846
|
+
)
|
572
847
|
end
|
573
848
|
|
574
849
|
alias_method :close_channel, :delete_channel
|
575
850
|
|
576
851
|
##
|
577
|
-
# @
|
578
|
-
# @
|
852
|
+
# @macro pChannelID
|
853
|
+
# @macro pOverwriteID
|
579
854
|
# @macro pBody
|
580
|
-
#
|
855
|
+
# @macro pReason
|
581
856
|
# @macro rResponse
|
582
857
|
#
|
583
858
|
# @see https://discord.com/developers/docs/resources/channel#edit-channel-permissions
|
584
859
|
# Discord documentation "Edit Channel Permissions"
|
585
|
-
def edit_channel_permissions(channel_id, overwrite_id, body)
|
586
|
-
json_request(
|
860
|
+
def edit_channel_permissions(channel_id, overwrite_id, body, reason: nil)
|
861
|
+
json_request(
|
862
|
+
:put,
|
863
|
+
discord("/channels/#{channel_id}/permissions/#{overwrite_id}"),
|
864
|
+
body:,
|
865
|
+
headers: auditlog(reason)
|
866
|
+
)
|
587
867
|
end
|
588
868
|
|
589
869
|
##
|
590
|
-
# @
|
870
|
+
# @macro pChannelID
|
871
|
+
# @macro pReason
|
591
872
|
# @macro rResponse
|
592
873
|
#
|
593
874
|
# @see https://discord.com/developers/docs/resources/channel#get-channel-invites
|
594
875
|
# Discord documentation "Get Channel Invites"
|
595
|
-
def get_channel_invites(channel_id)
|
596
|
-
json_request(
|
876
|
+
def get_channel_invites(channel_id, reason: nil)
|
877
|
+
json_request(
|
878
|
+
:get,
|
879
|
+
discord("/channels/#{channel_id}/invites"),
|
880
|
+
headers: auditlog(reason)
|
881
|
+
)
|
597
882
|
end
|
598
883
|
|
599
884
|
##
|
600
|
-
# @
|
885
|
+
# @macro pChannelID
|
601
886
|
# @macro pBody
|
887
|
+
# @macro pReason
|
602
888
|
# @macro rResponse
|
603
889
|
#
|
604
890
|
# @see https://discord.com/developers/docs/resources/channel#create-channel-invite
|
605
891
|
# Discord documentation "Create Channel Invite"
|
606
|
-
def create_channel_invite(channel_id, body)
|
607
|
-
json_request(
|
892
|
+
def create_channel_invite(channel_id, body, reason: nil)
|
893
|
+
json_request(
|
894
|
+
:post,
|
895
|
+
discord("/channels/#{channel_id}/invites"),
|
896
|
+
body:,
|
897
|
+
headers: auditlog(reason)
|
898
|
+
)
|
608
899
|
end
|
609
900
|
|
610
901
|
##
|
611
|
-
# @
|
612
|
-
# @
|
902
|
+
# @macro pChannelID
|
903
|
+
# @macro pOverwriteID
|
904
|
+
# @macro pReason
|
613
905
|
# @macro rResponse
|
614
906
|
#
|
615
907
|
# @see https://discord.com/developers/docs/resources/channel#delete-channel-permission
|
616
908
|
# Discord documentation "Delete Channel Permission"
|
617
|
-
def delete_channel_permission(channel_id, overwrite_id)
|
618
|
-
json_request(
|
909
|
+
def delete_channel_permission(channel_id, overwrite_id, reason: nil)
|
910
|
+
json_request(
|
911
|
+
:delete,
|
912
|
+
discord("/channels/#{channel_id}/permissions/#{overwrite_id}"),
|
913
|
+
headers: auditlog(reason)
|
914
|
+
)
|
619
915
|
end
|
620
916
|
|
621
917
|
##
|
622
|
-
# @
|
918
|
+
# @macro pChannelID
|
623
919
|
# @macro pBody
|
920
|
+
# @macro pReason
|
624
921
|
# @macro rResponse
|
625
922
|
#
|
626
923
|
# @see https://discord.com/developers/docs/resources/channel#follow-announcement-channel
|
627
924
|
# Discord documentation "Follow Announcement Channel"
|
628
|
-
def follow_announcement_channel(channel_id, body)
|
629
|
-
json_request(
|
925
|
+
def follow_announcement_channel(channel_id, body, reason: nil)
|
926
|
+
json_request(
|
927
|
+
:post,
|
928
|
+
discord("/channels/#{channel_id}/followers"),
|
929
|
+
body:,
|
930
|
+
headers: auditlog(reason)
|
931
|
+
)
|
630
932
|
end
|
631
933
|
|
632
934
|
##
|
633
|
-
# @
|
935
|
+
# @macro pChannelID
|
936
|
+
# @macro pReason
|
634
937
|
# @macro rResponse
|
635
938
|
#
|
636
939
|
# @see https://discord.com/developers/docs/resources/channel#trigger-typing-indicator
|
637
940
|
# Discord documentation "Trigger Typing Indicator"
|
638
|
-
def trigger_typing_indicator(channel_id)
|
639
|
-
json_request(
|
941
|
+
def trigger_typing_indicator(channel_id, reason: nil)
|
942
|
+
json_request(
|
943
|
+
:post,
|
944
|
+
discord("/channels/#{channel_id}/typing"),
|
945
|
+
headers: auditlog(reason)
|
946
|
+
)
|
640
947
|
end
|
641
948
|
|
642
949
|
##
|
643
|
-
# @
|
950
|
+
# @macro pChannelID
|
951
|
+
# @macro pReason
|
644
952
|
# @macro rResponse
|
645
953
|
#
|
646
954
|
# @see https://discord.com/developers/docs/resources/channel#get-pinned-messages
|
647
955
|
# Discord documentation "Get Pinned Messages"
|
648
|
-
def get_pinned_messages(channel_id)
|
649
|
-
json_request(
|
956
|
+
def get_pinned_messages(channel_id, reason: nil)
|
957
|
+
json_request(
|
958
|
+
:get,
|
959
|
+
discord("/channels/#{channel_id}/pins"),
|
960
|
+
headers: auditlog(reason)
|
961
|
+
)
|
650
962
|
end
|
651
963
|
|
652
964
|
##
|
653
|
-
# @
|
654
|
-
# @
|
965
|
+
# @macro pChannelID
|
966
|
+
# @macro pMessageID
|
967
|
+
# @macro pReason
|
655
968
|
# @macro rResponse
|
656
969
|
#
|
657
970
|
# @see https://discord.com/developers/docs/resources/channel#pin-message
|
658
971
|
# Discord documentation "Pin Message"
|
659
|
-
def pin_message(channel_id, message_id)
|
660
|
-
json_request(
|
972
|
+
def pin_message(channel_id, message_id, reason: nil)
|
973
|
+
json_request(
|
974
|
+
:put,
|
975
|
+
discord("/channels/#{channel_id}/pins/#{message_id}"),
|
976
|
+
headers: auditlog(reason)
|
977
|
+
)
|
661
978
|
end
|
662
979
|
|
663
980
|
##
|
664
|
-
# @
|
665
|
-
# @
|
981
|
+
# @macro pChannelID
|
982
|
+
# @macro pMessageID
|
983
|
+
# @macro pReason
|
666
984
|
# @macro rResponse
|
667
985
|
#
|
668
986
|
# @see https://discord.com/developers/docs/resources/channel#unpin-message
|
669
987
|
# Discord documentation "Unpin Message"
|
670
|
-
def unpin_message(channel_id, message_id)
|
671
|
-
json_request(
|
988
|
+
def unpin_message(channel_id, message_id, reason: nil)
|
989
|
+
json_request(
|
990
|
+
:delete,
|
991
|
+
discord("/channels/#{channel_id}/pins/#{message_id}"),
|
992
|
+
headers: auditlog(reason)
|
993
|
+
)
|
672
994
|
end
|
673
995
|
|
674
996
|
##
|
675
|
-
# @
|
676
|
-
# @
|
997
|
+
# @macro pChannelID
|
998
|
+
# @macro pUserID
|
677
999
|
# @macro pBody
|
1000
|
+
# @macro pReason
|
678
1001
|
# @macro rResponse
|
679
1002
|
#
|
680
1003
|
# @see https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
681
1004
|
# Discord documentation "Group DM Add Recipient"
|
682
|
-
def group_dm_add_recipient(channel_id, user_id, body)
|
683
|
-
json_request(
|
1005
|
+
def group_dm_add_recipient(channel_id, user_id, body, reason: nil)
|
1006
|
+
json_request(
|
1007
|
+
:put,
|
1008
|
+
discord("/channels/#{channel_id}/recipients/#{user_id}"),
|
1009
|
+
body:,
|
1010
|
+
headers: auditlog(reason)
|
1011
|
+
)
|
684
1012
|
end
|
685
1013
|
|
686
1014
|
##
|
687
|
-
# @
|
688
|
-
# @
|
1015
|
+
# @macro pChannelID
|
1016
|
+
# @macro pUserID
|
1017
|
+
# @macro pReason
|
689
1018
|
# @macro rResponse
|
690
1019
|
#
|
691
1020
|
# @see https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient
|
692
1021
|
# Discord documentation "Group DM Remove Recipient"
|
693
|
-
def group_dm_remove_recipient(channel_id, user_id)
|
694
|
-
json_request(
|
1022
|
+
def group_dm_remove_recipient(channel_id, user_id, reason: nil)
|
1023
|
+
json_request(
|
1024
|
+
:delete,
|
1025
|
+
discord("/channels/#{channel_id}/recipients/#{user_id}"),
|
1026
|
+
headers: auditlog(reason)
|
1027
|
+
)
|
695
1028
|
end
|
696
1029
|
|
697
1030
|
##
|
698
|
-
# @
|
699
|
-
# @
|
1031
|
+
# @macro pChannelID
|
1032
|
+
# @macro pMessageID
|
700
1033
|
# @macro pBody
|
1034
|
+
# @macro pReason
|
701
1035
|
# @macro rResponse
|
702
1036
|
#
|
703
1037
|
# @see https://discord.com/developers/docs/resources/channel#start-thread-from-message
|
704
1038
|
# Discord documentation "Start Thread from Message"
|
705
|
-
def start_thread_from_message(channel_id, message_id, body)
|
706
|
-
json_request(
|
1039
|
+
def start_thread_from_message(channel_id, message_id, body, reason: nil)
|
1040
|
+
json_request(
|
1041
|
+
:post,
|
1042
|
+
discord("/channels/#{channel_id}/messages/#{message_id}/threads"),
|
1043
|
+
body:,
|
1044
|
+
headers: auditlog(reason)
|
1045
|
+
)
|
707
1046
|
end
|
708
1047
|
|
709
1048
|
##
|
710
|
-
# @
|
1049
|
+
# @macro pChannelID
|
711
1050
|
# @macro pBody
|
1051
|
+
# @macro pReason
|
712
1052
|
# @macro rResponse
|
713
1053
|
#
|
714
1054
|
# @see https://discord.com/developers/docs/resources/channel#start-thread-without-message
|
715
1055
|
# Discord documentation "Start Thread without Message"
|
716
|
-
def start_thread_without_message(channel_id, body)
|
717
|
-
json_request(
|
1056
|
+
def start_thread_without_message(channel_id, body, reason: nil)
|
1057
|
+
json_request(
|
1058
|
+
:post,
|
1059
|
+
discord("/channels/#{channel_id}/threads"),
|
1060
|
+
body:,
|
1061
|
+
headers: auditlog(reason)
|
1062
|
+
)
|
718
1063
|
end
|
719
1064
|
|
720
1065
|
##
|
721
|
-
# @
|
1066
|
+
# @macro pChannelID
|
722
1067
|
# @macro pBody
|
1068
|
+
# @macro pReason
|
723
1069
|
# @macro rResponse
|
724
1070
|
#
|
725
1071
|
# @see https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel
|
726
1072
|
# Discord documentation "Start Thread in Forum or Media Channel"
|
727
|
-
def start_thread_in_forum_or_media_channel(channel_id, body)
|
728
|
-
json_request(
|
1073
|
+
def start_thread_in_forum_or_media_channel(channel_id, body, reason: nil)
|
1074
|
+
json_request(
|
1075
|
+
:post,
|
1076
|
+
discord("/channels/#{channel_id}/threads"),
|
1077
|
+
body:,
|
1078
|
+
headers: auditlog(reason)
|
1079
|
+
)
|
729
1080
|
end
|
730
1081
|
|
731
1082
|
##
|
732
|
-
# @
|
1083
|
+
# @macro pChannelID
|
1084
|
+
# @macro pReason
|
733
1085
|
# @macro rResponse
|
734
1086
|
#
|
735
1087
|
# @see https://discord.com/developers/docs/resources/channel#join-thread
|
736
1088
|
# Discord documentation "Join Thread"
|
737
|
-
def join_thread(channel_id)
|
738
|
-
json_request(
|
1089
|
+
def join_thread(channel_id, reason: nil)
|
1090
|
+
json_request(
|
1091
|
+
:put,
|
1092
|
+
discord("/channels/#{channel_id}/thread-members/@me"),
|
1093
|
+
headers: auditlog(reason)
|
1094
|
+
)
|
739
1095
|
end
|
740
1096
|
|
741
1097
|
##
|
742
|
-
# @
|
743
|
-
# @
|
1098
|
+
# @macro pChannelID
|
1099
|
+
# @macro pUserID
|
1100
|
+
# @macro pReason
|
744
1101
|
# @macro rResponse
|
745
1102
|
#
|
746
1103
|
# @see https://discord.com/developers/docs/resources/channel#add-thread-member
|
747
1104
|
# Discord documentation "Add Thread Member"
|
748
|
-
def add_thread_member(channel_id, user_id)
|
749
|
-
json_request(
|
1105
|
+
def add_thread_member(channel_id, user_id, reason: nil)
|
1106
|
+
json_request(
|
1107
|
+
:put,
|
1108
|
+
discord("/channels/#{channel_id}/thread-members/#{user_id}"),
|
1109
|
+
headers: auditlog(reason)
|
1110
|
+
)
|
750
1111
|
end
|
751
1112
|
|
752
1113
|
##
|
753
|
-
# @
|
1114
|
+
# @macro pChannelID
|
1115
|
+
# @macro pReason
|
754
1116
|
# @macro rResponse
|
755
1117
|
#
|
756
1118
|
# @see https://discord.com/developers/docs/resources/channel#leave-thread
|
757
1119
|
# Discord documentation "Leave Thread"
|
758
|
-
def leave_thread(channel_id)
|
759
|
-
json_request(
|
1120
|
+
def leave_thread(channel_id, reason: nil)
|
1121
|
+
json_request(
|
1122
|
+
:delete,
|
1123
|
+
discord("/channels/#{channel_id}/thread-members/@me"),
|
1124
|
+
headers: auditlog(reason)
|
1125
|
+
)
|
760
1126
|
end
|
761
1127
|
|
762
1128
|
##
|
763
|
-
# @
|
764
|
-
# @
|
1129
|
+
# @macro pChannelID
|
1130
|
+
# @macro pUserID
|
1131
|
+
# @macro pReason
|
765
1132
|
# @macro rResponse
|
766
1133
|
#
|
767
1134
|
# @see https://discord.com/developers/docs/resources/channel#remove-thread-member
|
768
1135
|
# Discord documentation "Remove Thread Member"
|
769
|
-
def remove_thread_member(channel_id, user_id)
|
770
|
-
json_request(
|
1136
|
+
def remove_thread_member(channel_id, user_id, reason: nil)
|
1137
|
+
json_request(
|
1138
|
+
:delete,
|
1139
|
+
discord("/channels/#{channel_id}/thread-members/#{user_id}"),
|
1140
|
+
headers: auditlog(reason)
|
1141
|
+
)
|
771
1142
|
end
|
772
1143
|
|
773
1144
|
##
|
774
|
-
# @
|
775
|
-
# @
|
1145
|
+
# @macro pChannelID
|
1146
|
+
# @macro pUserID
|
776
1147
|
# @macro pQuery
|
1148
|
+
# @macro pReason
|
777
1149
|
# @macro rResponse
|
778
1150
|
#
|
779
1151
|
# @see https://discord.com/developers/docs/resources/channel#get-thread-member
|
780
1152
|
# Discord documentation "Get Thread Member"
|
781
|
-
def get_thread_member(channel_id, user_id, query = {})
|
782
|
-
json_request(
|
1153
|
+
def get_thread_member(channel_id, user_id, query = {}, reason: nil)
|
1154
|
+
json_request(
|
1155
|
+
:get,
|
1156
|
+
discord("/channels/#{channel_id}/thread-members/#{user_id}"),
|
1157
|
+
query:,
|
1158
|
+
headers: auditlog(reason)
|
1159
|
+
)
|
783
1160
|
end
|
784
1161
|
|
785
1162
|
##
|
786
|
-
# @
|
1163
|
+
# @macro pChannelID
|
787
1164
|
# @macro pQuery
|
1165
|
+
# @macro pReason
|
788
1166
|
# @macro rResponse
|
789
1167
|
#
|
790
1168
|
# @see https://discord.com/developers/docs/resources/channel#list-thread-members
|
791
1169
|
# Discord documentation "List Thread Members"
|
792
|
-
def list_thread_members(channel_id, query = {})
|
793
|
-
json_request(
|
1170
|
+
def list_thread_members(channel_id, query = {}, reason: nil)
|
1171
|
+
json_request(
|
1172
|
+
:get,
|
1173
|
+
discord("/channels/#{channel_id}/thread-members"),
|
1174
|
+
query:,
|
1175
|
+
headers: auditlog(reason)
|
1176
|
+
)
|
794
1177
|
end
|
795
1178
|
|
796
1179
|
##
|
797
|
-
# @
|
1180
|
+
# @macro pChannelID
|
798
1181
|
# @macro pQuery
|
799
|
-
#
|
1182
|
+
# @macro pReason
|
800
1183
|
# @macro rResponse
|
801
1184
|
#
|
802
1185
|
# @see https://discord.com/developers/docs/resources/channel#list-public-archived-threads
|
803
1186
|
# Discord documentation "List Public Archived Threads"
|
804
|
-
def list_public_archived_threads(channel_id, query = {})
|
805
|
-
json_request(
|
1187
|
+
def list_public_archived_threads(channel_id, query = {}, reason: nil)
|
1188
|
+
json_request(
|
1189
|
+
:get,
|
1190
|
+
discord("/channels/#{channel_id}/threads/archived/public"),
|
1191
|
+
query:,
|
1192
|
+
headers: auditlog(reason)
|
1193
|
+
)
|
806
1194
|
end
|
807
1195
|
|
808
1196
|
##
|
809
|
-
# @
|
1197
|
+
# @macro pChannelID
|
810
1198
|
# @macro pQuery
|
1199
|
+
# @macro pReason
|
811
1200
|
# @macro rResponse
|
812
1201
|
#
|
813
1202
|
# @see https://discord.com/developers/docs/resources/channel#list-private-archived-threads
|
814
1203
|
# Discord documentation "List Private Archived Threads"
|
815
|
-
def list_private_archived_threads(channel_id, query = {})
|
816
|
-
json_request(
|
1204
|
+
def list_private_archived_threads(channel_id, query = {}, reason: nil)
|
1205
|
+
json_request(
|
1206
|
+
:get,
|
1207
|
+
discord("/channels/#{channel_id}/threads/archived/private"),
|
1208
|
+
query:,
|
1209
|
+
headers: auditlog(reason)
|
1210
|
+
)
|
817
1211
|
end
|
818
1212
|
|
819
1213
|
##
|
820
|
-
# @
|
1214
|
+
# @macro pChannelID
|
821
1215
|
# @macro pQuery
|
1216
|
+
# @macro pReason
|
822
1217
|
# @macro rResponse
|
823
1218
|
#
|
824
1219
|
# @see https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads
|
825
1220
|
# Discord documentation "List Joined Private Archived Threads"
|
826
|
-
def list_joined_private_archived_threads(channel_id, query = {})
|
827
|
-
json_request(
|
1221
|
+
def list_joined_private_archived_threads(channel_id, query = {}, reason: nil)
|
1222
|
+
json_request(
|
1223
|
+
:get,
|
1224
|
+
discord("/channels/#{channel_id}/users/@me/threads/archived/private"),
|
1225
|
+
query:,
|
1226
|
+
headers: auditlog(reason)
|
1227
|
+
)
|
828
1228
|
end
|
829
1229
|
|
830
1230
|
### }}} Channel
|
@@ -832,113 +1232,167 @@ module LibDiscord
|
|
832
1232
|
### Emoji {{{
|
833
1233
|
|
834
1234
|
##
|
835
|
-
# @
|
1235
|
+
# @macro pGuildID
|
1236
|
+
# @macro pReason
|
836
1237
|
# @macro rResponse
|
837
1238
|
#
|
838
1239
|
# @see https://discord.com/developers/docs/resources/emoji#list-guild-emojis
|
839
1240
|
# Discord documentation "List Guild Emojis"
|
840
|
-
def list_guild_emojis(guild_id)
|
841
|
-
json_request(
|
1241
|
+
def list_guild_emojis(guild_id, reason: nil)
|
1242
|
+
json_request(
|
1243
|
+
:get,
|
1244
|
+
discord("/guilds/#{guild_id}/emojis"),
|
1245
|
+
headers: auditlog(reason)
|
1246
|
+
)
|
842
1247
|
end
|
843
1248
|
|
844
1249
|
##
|
845
|
-
# @
|
846
|
-
# @
|
1250
|
+
# @macro pGuildID
|
1251
|
+
# @macro pEmojiID
|
1252
|
+
# @macro pReason
|
847
1253
|
# @macro rResponse
|
848
1254
|
#
|
849
1255
|
# @see https://discord.com/developers/docs/resources/emoji#get-guild-emoji
|
850
1256
|
# Discord documentation "Get Guild Emoji"
|
851
|
-
def get_guild_emoji(guild_id, emoji_id)
|
852
|
-
json_request(
|
1257
|
+
def get_guild_emoji(guild_id, emoji_id, reason: nil)
|
1258
|
+
json_request(
|
1259
|
+
:get,
|
1260
|
+
discord("/guilds/#{guild_id}/emojis/#{emoji_id}"),
|
1261
|
+
headers: auditlog(reason)
|
1262
|
+
)
|
853
1263
|
end
|
854
1264
|
|
855
1265
|
##
|
856
|
-
# @
|
1266
|
+
# @macro pGuildID
|
857
1267
|
# @macro pBody
|
1268
|
+
# @macro pReason
|
858
1269
|
# @macro rResponse
|
859
1270
|
#
|
860
1271
|
# @see https://discord.com/developers/docs/resources/emoji#create-guild-emoji
|
861
1272
|
# Discord documentation "Create Guild Emoji"
|
862
|
-
def create_guild_emoji(guild_id, body)
|
863
|
-
json_request(
|
1273
|
+
def create_guild_emoji(guild_id, body, reason: nil)
|
1274
|
+
json_request(
|
1275
|
+
:post,
|
1276
|
+
discord("/guilds/#{guild_id}/emojis"),
|
1277
|
+
body:,
|
1278
|
+
headers: auditlog(reason)
|
1279
|
+
)
|
864
1280
|
end
|
865
1281
|
|
866
1282
|
##
|
867
|
-
# @
|
868
|
-
# @
|
1283
|
+
# @macro pGuildID
|
1284
|
+
# @macro pEmojiID
|
869
1285
|
# @macro pBody
|
1286
|
+
# @macro pReason
|
870
1287
|
# @macro rResponse
|
871
1288
|
#
|
872
1289
|
# @see https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
|
873
1290
|
# Discord documentation "Modify Guild Emoji"
|
874
|
-
def modify_guild_emoji(guild_id, emoji_id, body)
|
875
|
-
json_request(
|
1291
|
+
def modify_guild_emoji(guild_id, emoji_id, body, reason: nil)
|
1292
|
+
json_request(
|
1293
|
+
:patch,
|
1294
|
+
discord("/guilds/#{guild_id}/emojis/#{emoji_id}"),
|
1295
|
+
body:,
|
1296
|
+
headers: auditlog(reason)
|
1297
|
+
)
|
876
1298
|
end
|
877
1299
|
|
878
1300
|
##
|
879
|
-
# @
|
880
|
-
# @
|
1301
|
+
# @macro pGuildID
|
1302
|
+
# @macro pEmojiID
|
1303
|
+
# @macro pReason
|
881
1304
|
# @macro rResponse
|
882
1305
|
#
|
883
1306
|
# @see https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
|
884
1307
|
# Discord documentation "Delete Guild Emoji"
|
885
|
-
def delete_guild_emoji(guild_id, emoji_id)
|
886
|
-
json_request(
|
1308
|
+
def delete_guild_emoji(guild_id, emoji_id, reason: nil)
|
1309
|
+
json_request(
|
1310
|
+
:delete,
|
1311
|
+
discord("/guilds/#{guild_id}/emojis/#{emoji_id}"),
|
1312
|
+
headers: auditlog(reason)
|
1313
|
+
)
|
887
1314
|
end
|
888
1315
|
|
889
1316
|
##
|
890
|
-
# @
|
1317
|
+
# @macro pApplicationID
|
1318
|
+
# @macro pReason
|
891
1319
|
# @macro rResponse
|
892
1320
|
#
|
893
1321
|
# @see https://discord.com/developers/docs/resources/emoji#list-application-emojis
|
894
1322
|
# Discord documentation "List Application Emojis"
|
895
|
-
def list_application_emojis(application_id)
|
896
|
-
json_request(
|
1323
|
+
def list_application_emojis(application_id, reason: nil)
|
1324
|
+
json_request(
|
1325
|
+
:get,
|
1326
|
+
discord("/applications/#{application_id}/emojis"),
|
1327
|
+
headers: auditlog(reason)
|
1328
|
+
)
|
897
1329
|
end
|
898
1330
|
|
899
1331
|
##
|
900
|
-
# @
|
901
|
-
# @
|
1332
|
+
# @macro pApplicationID
|
1333
|
+
# @macro pEmojiID
|
1334
|
+
# @macro pReason
|
902
1335
|
# @macro rResponse
|
903
1336
|
#
|
904
1337
|
# @see https://discord.com/developers/docs/resources/emoji#get-application-emoji
|
905
1338
|
# Discord documentation "Get Application Emoji"
|
906
|
-
def get_application_emoji(application_id, emoji_id)
|
907
|
-
json_request(
|
1339
|
+
def get_application_emoji(application_id, emoji_id, reason: nil)
|
1340
|
+
json_request(
|
1341
|
+
:get,
|
1342
|
+
discord("/applications/#{application_id}/emojis/#{emoji_id}"),
|
1343
|
+
headers: auditlog(reason)
|
1344
|
+
)
|
908
1345
|
end
|
909
1346
|
|
910
1347
|
##
|
911
|
-
# @
|
1348
|
+
# @macro pApplicationID
|
912
1349
|
# @macro pBody
|
1350
|
+
# @macro pReason
|
913
1351
|
# @macro rResponse
|
914
1352
|
#
|
915
1353
|
# @see https://discord.com/developers/docs/resources/emoji#create-application-emoji
|
916
1354
|
# Discord documentation "Create Application Emoji"
|
917
|
-
def create_application_emoji(application_id, body)
|
918
|
-
json_request(
|
1355
|
+
def create_application_emoji(application_id, body, reason: nil)
|
1356
|
+
json_request(
|
1357
|
+
:post,
|
1358
|
+
discord("/applications/#{application_id}/emojis"),
|
1359
|
+
body:,
|
1360
|
+
headers: auditlog(reason)
|
1361
|
+
)
|
919
1362
|
end
|
920
1363
|
|
921
1364
|
##
|
922
|
-
# @
|
923
|
-
# @
|
1365
|
+
# @macro pApplicationID
|
1366
|
+
# @macro pEmojiID
|
924
1367
|
# @macro pBody
|
1368
|
+
# @macro pReason
|
925
1369
|
# @macro rResponse
|
926
1370
|
#
|
927
1371
|
# @see https://discord.com/developers/docs/resources/emoji#modify-application-emoji
|
928
1372
|
# Discord documentation "Modify Application Emoji"
|
929
|
-
def modify_application_emoji(application_id, emoji_id, body)
|
930
|
-
json_request(
|
1373
|
+
def modify_application_emoji(application_id, emoji_id, body, reason: nil)
|
1374
|
+
json_request(
|
1375
|
+
:patch,
|
1376
|
+
discord("/applications/#{application_id}/emojis/#{emoji_id}"),
|
1377
|
+
body:,
|
1378
|
+
headers: auditlog(reason)
|
1379
|
+
)
|
931
1380
|
end
|
932
1381
|
|
933
1382
|
##
|
934
|
-
# @
|
935
|
-
# @
|
1383
|
+
# @macro pApplicationID
|
1384
|
+
# @macro pEmojiID
|
1385
|
+
# @macro pReason
|
936
1386
|
# @macro rResponse
|
937
1387
|
#
|
938
1388
|
# @see https://discord.com/developers/docs/resources/emoji#delete-application-emoji
|
939
1389
|
# Discord documentation "Delete Application Emoji"
|
940
|
-
def delete_application_emoji(application_id, emoji_id)
|
941
|
-
json_request(
|
1390
|
+
def delete_application_emoji(application_id, emoji_id, reason: nil)
|
1391
|
+
json_request(
|
1392
|
+
:delete,
|
1393
|
+
discord("/applications/#{application_id}/emojis/#{emoji_id}"),
|
1394
|
+
headers: auditlog(reason)
|
1395
|
+
)
|
942
1396
|
end
|
943
1397
|
|
944
1398
|
### }}} Emoji
|
@@ -946,56 +1400,82 @@ module LibDiscord
|
|
946
1400
|
### Entitlement {{{
|
947
1401
|
|
948
1402
|
##
|
949
|
-
# @
|
1403
|
+
# @macro pApplicationID
|
1404
|
+
# @macro pReason
|
950
1405
|
# @macro rResponse
|
951
1406
|
#
|
952
1407
|
# @see https://discord.com/developers/docs/resources/entitlement#list-entitlements
|
953
1408
|
# Discord documentation "List Entitlements"
|
954
|
-
def list_entitlements(application_id)
|
955
|
-
json_request(
|
1409
|
+
def list_entitlements(application_id, reason: nil)
|
1410
|
+
json_request(
|
1411
|
+
:get,
|
1412
|
+
discord("/applications/#{application_id}/entitlements"),
|
1413
|
+
headers: auditlog(reason)
|
1414
|
+
)
|
956
1415
|
end
|
957
1416
|
|
958
1417
|
##
|
959
|
-
# @
|
960
|
-
# @
|
1418
|
+
# @macro pApplicationID
|
1419
|
+
# @macro pEntitlementID
|
1420
|
+
# @macro pReason
|
961
1421
|
# @macro rResponse
|
962
1422
|
#
|
963
1423
|
# @see https://discord.com/developers/docs/resources/entitlement#get-entitlement
|
964
1424
|
# Discord documentation "Get Entitlement"
|
965
|
-
def get_entitlement(application_id, entitlement_id)
|
966
|
-
json_request(
|
1425
|
+
def get_entitlement(application_id, entitlement_id, reason: nil)
|
1426
|
+
json_request(
|
1427
|
+
:get,
|
1428
|
+
discord("/applications/#{application_id}/entitlements/#{entitlement_id}"),
|
1429
|
+
headers: auditlog(reason)
|
1430
|
+
)
|
967
1431
|
end
|
968
1432
|
|
969
1433
|
##
|
970
|
-
# @
|
971
|
-
# @
|
1434
|
+
# @macro pApplicationID
|
1435
|
+
# @macro pEntitlementID
|
1436
|
+
# @macro pReason
|
972
1437
|
# @macro rResponse
|
973
1438
|
#
|
974
1439
|
# @see https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement
|
975
1440
|
# Discord documentation "Consume an Entitlement"
|
976
|
-
def consume_entitlement(application_id, entitlement_id)
|
977
|
-
json_request(
|
1441
|
+
def consume_entitlement(application_id, entitlement_id, reason: nil)
|
1442
|
+
json_request(
|
1443
|
+
:post,
|
1444
|
+
discord("/applications/#{application_id}/entitlements/#{entitlement_id}/consume"),
|
1445
|
+
headers: auditlog(reason)
|
1446
|
+
)
|
978
1447
|
end
|
979
1448
|
|
980
1449
|
##
|
981
|
-
# @
|
1450
|
+
# @macro pApplicationID
|
1451
|
+
# @macro pReason
|
982
1452
|
# @macro rResponse
|
983
1453
|
#
|
984
1454
|
# @see https://discord.com/developers/docs/resources/entitlement#create-test-entitlement
|
985
1455
|
# Discord documentation "Create Test Entitlement"
|
986
|
-
def create_test_entitlement(application_id, body)
|
987
|
-
json_request(
|
1456
|
+
def create_test_entitlement(application_id, body, reason: nil)
|
1457
|
+
json_request(
|
1458
|
+
:post,
|
1459
|
+
discord("/applications/#{application_id}/entitlements"),
|
1460
|
+
body:,
|
1461
|
+
headers: auditlog(reason)
|
1462
|
+
)
|
988
1463
|
end
|
989
1464
|
|
990
1465
|
##
|
991
|
-
# @
|
992
|
-
# @
|
1466
|
+
# @macro pApplicationID
|
1467
|
+
# @macro pEntitlementID
|
1468
|
+
# @macro pReason
|
993
1469
|
# @macro rResponse
|
994
1470
|
#
|
995
1471
|
# @see https://discord.com/developers/docs/resources/entitlement#delete-test-entitlement
|
996
1472
|
# Discord documentation "Delete Test Entitlement"
|
997
|
-
def delete_test_entitlement(application_id, entitlement_id)
|
998
|
-
json_request(
|
1473
|
+
def delete_test_entitlement(application_id, entitlement_id, reason: nil)
|
1474
|
+
json_request(
|
1475
|
+
:delete,
|
1476
|
+
discord("/applications/#{application_id}/entitlements/#{entitlement_id}"),
|
1477
|
+
headers: auditlog(reason)
|
1478
|
+
)
|
999
1479
|
end
|
1000
1480
|
|
1001
1481
|
### }}} Entitlement
|
@@ -1003,72 +1483,107 @@ module LibDiscord
|
|
1003
1483
|
### Guild Scheduled Event {{{
|
1004
1484
|
|
1005
1485
|
##
|
1006
|
-
# @
|
1486
|
+
# @macro pGuildID
|
1007
1487
|
# @macro pQuery
|
1488
|
+
# @macro pReason
|
1008
1489
|
# @macro rResponse
|
1009
1490
|
#
|
1010
1491
|
# @see https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild
|
1011
1492
|
# Discord documentation "List Scheduled Events for Guild"
|
1012
|
-
def list_scheduled_events_for_guild(guild_id, query = {})
|
1013
|
-
json_request(
|
1493
|
+
def list_scheduled_events_for_guild(guild_id, query = {}, reason: nil)
|
1494
|
+
json_request(
|
1495
|
+
:get,
|
1496
|
+
discord("/guilds/#{guild_id}/scheduled-events"),
|
1497
|
+
query:,
|
1498
|
+
headers: auditlog(reason)
|
1499
|
+
)
|
1014
1500
|
end
|
1015
1501
|
|
1016
1502
|
##
|
1017
|
-
# @
|
1503
|
+
# @macro pGuildID
|
1018
1504
|
# @macro pBody
|
1505
|
+
# @macro pReason
|
1019
1506
|
# @macro rResponse
|
1020
1507
|
#
|
1021
1508
|
# @see https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
|
1022
1509
|
# Discord documentation "Create Guild Scheduled Event"
|
1023
|
-
def create_guild_scheduled_event(guild_id, body)
|
1024
|
-
json_request(
|
1510
|
+
def create_guild_scheduled_event(guild_id, body, reason: nil)
|
1511
|
+
json_request(
|
1512
|
+
:post,
|
1513
|
+
discord("/guilds/#{guild_id}/scheduled-events"),
|
1514
|
+
body:,
|
1515
|
+
headers: auditlog(reason)
|
1516
|
+
)
|
1025
1517
|
end
|
1026
1518
|
|
1027
1519
|
##
|
1028
|
-
# @
|
1029
|
-
# @
|
1520
|
+
# @macro pGuildID
|
1521
|
+
# @macro pGuildScheduledEventID
|
1030
1522
|
# @macro pQuery
|
1523
|
+
# @macro pReason
|
1031
1524
|
# @macro rResponse
|
1032
1525
|
#
|
1033
1526
|
# @see https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event
|
1034
1527
|
# Discord documentation "Get Guild Scheduled Event"
|
1035
|
-
def get_guild_scheduled_event(guild_id, guild_scheduled_event_id, query = {})
|
1036
|
-
json_request(
|
1528
|
+
def get_guild_scheduled_event(guild_id, guild_scheduled_event_id, query = {}, reason: nil)
|
1529
|
+
json_request(
|
1530
|
+
:get,
|
1531
|
+
discord("/guilds/#{guild_id}/scheduled-events/#{guild_scheduled_event_id}"),
|
1532
|
+
query:,
|
1533
|
+
headers: auditlog(reason)
|
1534
|
+
)
|
1037
1535
|
end
|
1038
1536
|
|
1039
1537
|
##
|
1040
|
-
# @
|
1041
|
-
# @
|
1538
|
+
# @macro pGuildID
|
1539
|
+
# @macro pGuildScheduledEventID
|
1042
1540
|
# @macro pBody
|
1541
|
+
# @macro pReason
|
1043
1542
|
# @macro rResponse
|
1044
1543
|
#
|
1045
1544
|
# @see https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
1046
1545
|
# Discord documentation "Modify Guild Scheduled Event"
|
1047
|
-
def modify_guild_scheduled_event(guild_id, guild_scheduled_event_id, body)
|
1048
|
-
json_request(
|
1546
|
+
def modify_guild_scheduled_event(guild_id, guild_scheduled_event_id, body, reason: nil)
|
1547
|
+
json_request(
|
1548
|
+
:patch,
|
1549
|
+
discord("/guilds/#{guild_id}/scheduled-events/#{guild_scheduled_event_id}"),
|
1550
|
+
body:,
|
1551
|
+
headers: auditlog(reason)
|
1552
|
+
)
|
1049
1553
|
end
|
1050
1554
|
|
1051
1555
|
##
|
1052
|
-
# @
|
1053
|
-
# @
|
1556
|
+
# @macro pGuildID
|
1557
|
+
# @macro pGuildScheduledEventID
|
1558
|
+
# @macro pReason
|
1054
1559
|
# @macro rResponse
|
1055
1560
|
#
|
1056
1561
|
# @see https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event
|
1057
1562
|
# Discord documentation "Delete Guild Scheduled Event"
|
1058
|
-
def delete_guild_scheduled_event(guild_id, guild_scheduled_event_id)
|
1059
|
-
json_request(
|
1563
|
+
def delete_guild_scheduled_event(guild_id, guild_scheduled_event_id, reason: nil)
|
1564
|
+
json_request(
|
1565
|
+
:delete,
|
1566
|
+
discord("/guilds/#{guild_id}/scheduled-events/#{guild_scheduled_event_id}"),
|
1567
|
+
headers: auditlog(reason)
|
1568
|
+
)
|
1060
1569
|
end
|
1061
1570
|
|
1062
1571
|
##
|
1063
|
-
# @
|
1064
|
-
# @
|
1572
|
+
# @macro pGuildID
|
1573
|
+
# @macro pGuildScheduledEventID
|
1065
1574
|
# @macro pQuery
|
1575
|
+
# @macro pReason
|
1066
1576
|
# @macro rResponse
|
1067
1577
|
#
|
1068
1578
|
# @see https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users
|
1069
1579
|
# Discord documentation "Get Guild Scheduled Event Users"
|
1070
|
-
def get_guild_scheduled_event_users(guild_id, guild_scheduled_event_id, query = {})
|
1071
|
-
json_request(
|
1580
|
+
def get_guild_scheduled_event_users(guild_id, guild_scheduled_event_id, query = {}, reason: nil)
|
1581
|
+
json_request(
|
1582
|
+
:get,
|
1583
|
+
discord("/guilds/#{guild_id}/scheduled-events/#{guild_scheduled_event_id}/users"),
|
1584
|
+
query:,
|
1585
|
+
headers: auditlog(reason)
|
1586
|
+
)
|
1072
1587
|
end
|
1073
1588
|
|
1074
1589
|
### }}} Guild Scheduled Event
|
@@ -1076,79 +1591,117 @@ module LibDiscord
|
|
1076
1591
|
### Guild Template {{{
|
1077
1592
|
|
1078
1593
|
##
|
1079
|
-
# @
|
1594
|
+
# @macro pTemplateCode
|
1595
|
+
# @macro pReason
|
1080
1596
|
# @macro rResponse
|
1081
1597
|
#
|
1082
1598
|
# @see https://discord.com/developers/docs/resources/guild-template#get-guild-template
|
1083
1599
|
# Discord documentation "Get Guild Template"
|
1084
|
-
def get_guild_template(template_code)
|
1085
|
-
json_request(
|
1600
|
+
def get_guild_template(template_code, reason: nil)
|
1601
|
+
json_request(
|
1602
|
+
:get,
|
1603
|
+
discord("/guilds/templates/#{template_code}"),
|
1604
|
+
headers: auditlog(reason)
|
1605
|
+
)
|
1086
1606
|
end
|
1087
1607
|
|
1088
1608
|
##
|
1089
|
-
# @
|
1609
|
+
# @macro pTemplateCode
|
1090
1610
|
# @macro pBody
|
1611
|
+
# @macro pReason
|
1091
1612
|
# @macro rResponse
|
1092
1613
|
#
|
1093
1614
|
# @see https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template
|
1094
1615
|
# Discord documentation "Create Guild from Guild Template"
|
1095
|
-
def create_guild_from_guild_template(template_code, body)
|
1096
|
-
json_request(
|
1616
|
+
def create_guild_from_guild_template(template_code, body, reason: nil)
|
1617
|
+
json_request(
|
1618
|
+
:post,
|
1619
|
+
discord("/guilds/templates/#{template_code}"),
|
1620
|
+
body:,
|
1621
|
+
headers: auditlog(reason)
|
1622
|
+
)
|
1097
1623
|
end
|
1098
1624
|
|
1099
1625
|
##
|
1100
|
-
# @
|
1626
|
+
# @macro pGuildID
|
1627
|
+
# @macro pReason
|
1101
1628
|
# @macro rResponse
|
1102
1629
|
#
|
1103
1630
|
# @see https://discord.com/developers/docs/resources/guild-template#get-guild-templates
|
1104
1631
|
# Discord documentation "Get Guild Templates"
|
1105
|
-
def get_guild_templates(guild_id)
|
1106
|
-
json_request(
|
1632
|
+
def get_guild_templates(guild_id, reason: nil)
|
1633
|
+
json_request(
|
1634
|
+
:get,
|
1635
|
+
discord("/guilds/#{guild_id}/templates"),
|
1636
|
+
headers: auditlog(reason)
|
1637
|
+
)
|
1107
1638
|
end
|
1108
1639
|
|
1109
1640
|
##
|
1110
|
-
# @
|
1641
|
+
# @macro pGuildID
|
1111
1642
|
# @macro pBody
|
1643
|
+
# @macro pReason
|
1112
1644
|
# @macro rResponse
|
1113
1645
|
#
|
1114
1646
|
# @see https://discord.com/developers/docs/resources/guild-template#create-guild-template
|
1115
1647
|
# Discord documentation "Create Guild Template"
|
1116
|
-
def create_guild_template(guild_id, body)
|
1117
|
-
json_request(
|
1648
|
+
def create_guild_template(guild_id, body, reason: nil)
|
1649
|
+
json_request(
|
1650
|
+
:post,
|
1651
|
+
discord("/guilds/#{guild_id}/templates"),
|
1652
|
+
body:,
|
1653
|
+
headers: auditlog(reason)
|
1654
|
+
)
|
1118
1655
|
end
|
1119
1656
|
|
1120
1657
|
##
|
1121
|
-
# @
|
1122
|
-
# @
|
1658
|
+
# @macro pGuildID
|
1659
|
+
# @macro pTemplateCode
|
1660
|
+
# @macro pReason
|
1123
1661
|
# @macro rResponse
|
1124
1662
|
#
|
1125
1663
|
# @see https://discord.com/developers/docs/resources/guild-template#sync-guild-template
|
1126
1664
|
# Discord documentation "Sync Guild Template"
|
1127
|
-
def sync_guild_template(guild_id, template_code)
|
1128
|
-
json_request(
|
1665
|
+
def sync_guild_template(guild_id, template_code, reason: nil)
|
1666
|
+
json_request(
|
1667
|
+
:put,
|
1668
|
+
discord("/guilds/#{guild_id}/templates/#{template_code}"),
|
1669
|
+
headers: auditlog(reason)
|
1670
|
+
)
|
1129
1671
|
end
|
1130
1672
|
|
1131
1673
|
##
|
1132
|
-
# @
|
1133
|
-
# @
|
1674
|
+
# @macro pGuildID
|
1675
|
+
# @macro pTemplateCode
|
1134
1676
|
# @macro pBody
|
1677
|
+
# @macro pReason
|
1135
1678
|
# @macro rResponse
|
1136
1679
|
#
|
1137
1680
|
# @see https://discord.com/developers/docs/resources/guild-template#modify-guild-template
|
1138
1681
|
# Discord documentation "Modify Guild Template"
|
1139
|
-
def modify_guild_template(guild_id, template_code, body)
|
1140
|
-
json_request(
|
1682
|
+
def modify_guild_template(guild_id, template_code, body, reason: nil)
|
1683
|
+
json_request(
|
1684
|
+
:patch,
|
1685
|
+
discord("/guilds/#{guild_id}/templates/#{template_code}"),
|
1686
|
+
body:,
|
1687
|
+
headers: auditlog(reason)
|
1688
|
+
)
|
1141
1689
|
end
|
1142
1690
|
|
1143
1691
|
##
|
1144
|
-
# @
|
1145
|
-
# @
|
1692
|
+
# @macro pGuildID
|
1693
|
+
# @macro pTemplateCode
|
1694
|
+
# @macro pReason
|
1146
1695
|
# @macro rResponse
|
1147
1696
|
#
|
1148
1697
|
# @see https://discord.com/developers/docs/resources/guild-template#delete-guild-template
|
1149
1698
|
# Discord documentation "Delete Guild Template"
|
1150
|
-
def delete_guild_template(guild_id, template_code)
|
1151
|
-
json_request(
|
1699
|
+
def delete_guild_template(guild_id, template_code, reason: nil)
|
1700
|
+
json_request(
|
1701
|
+
:delete,
|
1702
|
+
discord("/guilds/#{guild_id}/templates/#{template_code}"),
|
1703
|
+
headers: auditlog(reason)
|
1704
|
+
)
|
1152
1705
|
end
|
1153
1706
|
|
1154
1707
|
### }}} Guild Template
|
@@ -1157,513 +1710,773 @@ module LibDiscord
|
|
1157
1710
|
|
1158
1711
|
##
|
1159
1712
|
# @macro pBody
|
1713
|
+
# @macro pReason
|
1160
1714
|
# @macro rResponse
|
1161
1715
|
#
|
1162
1716
|
# @see https://discord.com/developers/docs/resources/guild#create-guild
|
1163
1717
|
# Discord documentation "Create Guild"
|
1164
|
-
def create_guild(body)
|
1165
|
-
json_request(
|
1718
|
+
def create_guild(body, reason: nil)
|
1719
|
+
json_request(
|
1720
|
+
:post,
|
1721
|
+
discord("/guilds"),
|
1722
|
+
body:,
|
1723
|
+
headers: auditlog(reason)
|
1724
|
+
)
|
1166
1725
|
end
|
1167
1726
|
|
1168
1727
|
##
|
1169
|
-
# @
|
1728
|
+
# @macro pGuildID
|
1170
1729
|
# @macro pQuery
|
1730
|
+
# @macro pReason
|
1171
1731
|
# @macro rResponse
|
1172
1732
|
#
|
1173
1733
|
# @see https://discord.com/developers/docs/resources/guild#get-guild
|
1174
1734
|
# Discord documentation "Get Guild"
|
1175
|
-
def get_guild(guild_id, query = {})
|
1176
|
-
json_request(
|
1735
|
+
def get_guild(guild_id, query = {}, reason: nil)
|
1736
|
+
json_request(
|
1737
|
+
:get,
|
1738
|
+
discord("/guilds/#{guild_id}"),
|
1739
|
+
query:,
|
1740
|
+
headers: auditlog(reason)
|
1741
|
+
)
|
1177
1742
|
end
|
1178
1743
|
|
1179
1744
|
##
|
1180
|
-
# @
|
1745
|
+
# @macro pGuildID
|
1746
|
+
# @macro pReason
|
1181
1747
|
# @macro rResponse
|
1182
1748
|
#
|
1183
1749
|
# @see https://discord.com/developers/docs/resources/guild#get-guild-preview
|
1184
1750
|
# Discord documentation "Get Guild Preview"
|
1185
|
-
def get_guild_preview(guild_id)
|
1186
|
-
json_request(
|
1751
|
+
def get_guild_preview(guild_id, reason: nil)
|
1752
|
+
json_request(
|
1753
|
+
:get,
|
1754
|
+
discord("/guilds/#{guild_id}/preview"),
|
1755
|
+
headers: auditlog(reason)
|
1756
|
+
)
|
1187
1757
|
end
|
1188
1758
|
|
1189
1759
|
##
|
1190
|
-
# @
|
1760
|
+
# @macro pGuildID
|
1191
1761
|
# @macro pBody
|
1762
|
+
# @macro pReason
|
1192
1763
|
# @macro rResponse
|
1193
1764
|
#
|
1194
1765
|
# @see https://discord.com/developers/docs/resources/guild#modify-guild
|
1195
1766
|
# Discord documentation "Modify Guild"
|
1196
|
-
def modify_guild(guild_id, body)
|
1197
|
-
json_request(
|
1767
|
+
def modify_guild(guild_id, body, reason: nil)
|
1768
|
+
json_request(
|
1769
|
+
:patch,
|
1770
|
+
discord("/guilds/#{guild_id}"),
|
1771
|
+
body:,
|
1772
|
+
headers: auditlog(reason)
|
1773
|
+
)
|
1198
1774
|
end
|
1199
1775
|
|
1200
1776
|
##
|
1201
|
-
# @
|
1777
|
+
# @macro pGuildID
|
1778
|
+
# @macro pReason
|
1202
1779
|
# @macro rResponse
|
1203
1780
|
#
|
1204
1781
|
# @see https://discord.com/developers/docs/resources/guild#delete-guild
|
1205
1782
|
# Discord documentation "Delete Guild"
|
1206
|
-
def delete_guild(guild_id)
|
1207
|
-
json_request(
|
1783
|
+
def delete_guild(guild_id, reason: nil)
|
1784
|
+
json_request(
|
1785
|
+
:delete,
|
1786
|
+
discord("/guilds/#{guild_id}"),
|
1787
|
+
headers: auditlog(reason)
|
1788
|
+
)
|
1208
1789
|
end
|
1209
1790
|
|
1210
1791
|
##
|
1211
|
-
# @
|
1792
|
+
# @macro pGuildID
|
1793
|
+
# @macro pReason
|
1212
1794
|
# @macro rResponse
|
1213
1795
|
#
|
1214
1796
|
# @see https://discord.com/developers/docs/resources/guild#get-guild-channels
|
1215
1797
|
# Discord documentation "Get Guild Channels"
|
1216
|
-
def get_guild_channels(guild_id)
|
1217
|
-
json_request(
|
1798
|
+
def get_guild_channels(guild_id, reason: nil)
|
1799
|
+
json_request(
|
1800
|
+
:get,
|
1801
|
+
discord("/guilds/#{guild_id}/channels"),
|
1802
|
+
headers: auditlog(reason)
|
1803
|
+
)
|
1218
1804
|
end
|
1219
1805
|
|
1220
1806
|
##
|
1221
|
-
# @
|
1807
|
+
# @macro pGuildID
|
1222
1808
|
# @macro pBody
|
1809
|
+
# @macro pReason
|
1223
1810
|
# @macro rResponse
|
1224
1811
|
#
|
1225
1812
|
# @see https://discord.com/developers/docs/resources/guild#create-guild-channel
|
1226
1813
|
# Discord documentation "Create Guild Channel"
|
1227
|
-
def create_guild_channel(guild_id, body)
|
1228
|
-
json_request(
|
1814
|
+
def create_guild_channel(guild_id, body, reason: nil)
|
1815
|
+
json_request(
|
1816
|
+
:post,
|
1817
|
+
discord("/guilds/#{guild_id}/channels"),
|
1818
|
+
body:,
|
1819
|
+
headers: auditlog(reason)
|
1820
|
+
)
|
1229
1821
|
end
|
1230
1822
|
|
1231
1823
|
##
|
1232
|
-
# @
|
1824
|
+
# @macro pGuildID
|
1233
1825
|
# @macro pBody
|
1826
|
+
# @macro pReason
|
1234
1827
|
# @macro rResponse
|
1235
1828
|
#
|
1236
1829
|
# @see https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
|
1237
1830
|
# Discord documentation "Modify Guild Channel Positions"
|
1238
|
-
def modify_guild_channel_positions(guild_id, body)
|
1239
|
-
json_request(
|
1831
|
+
def modify_guild_channel_positions(guild_id, body, reason: nil)
|
1832
|
+
json_request(
|
1833
|
+
:patch,
|
1834
|
+
discord("/guilds/#{guild_id}/channels"),
|
1835
|
+
body:,
|
1836
|
+
headers: auditlog(reason)
|
1837
|
+
)
|
1240
1838
|
end
|
1241
1839
|
|
1242
1840
|
##
|
1243
|
-
# @
|
1841
|
+
# @macro pGuildID
|
1842
|
+
# @macro pReason
|
1244
1843
|
# @macro rResponse
|
1245
1844
|
#
|
1246
1845
|
# @see https://discord.com/developers/docs/resources/guild#list-active-guild-threads
|
1247
1846
|
# Discord documentation "List Active Guild Threads"
|
1248
|
-
def list_active_guild_threads(guild_id)
|
1249
|
-
json_request(
|
1847
|
+
def list_active_guild_threads(guild_id, reason: nil)
|
1848
|
+
json_request(
|
1849
|
+
:get,
|
1850
|
+
discord("/guilds/#{guild_id}/threads/active"),
|
1851
|
+
headers: auditlog(reason)
|
1852
|
+
)
|
1250
1853
|
end
|
1251
1854
|
|
1252
1855
|
##
|
1253
|
-
# @
|
1254
|
-
# @
|
1856
|
+
# @macro pGuildID
|
1857
|
+
# @macro pUserID
|
1858
|
+
# @macro pReason
|
1255
1859
|
# @macro rResponse
|
1256
1860
|
#
|
1257
1861
|
# @see https://discord.com/developers/docs/resources/guild#get-guild-member
|
1258
1862
|
# Discord documentation "Get Guild Member"
|
1259
|
-
def get_guild_member(guild_id, user_id)
|
1260
|
-
json_request(
|
1863
|
+
def get_guild_member(guild_id, user_id, reason: nil)
|
1864
|
+
json_request(
|
1865
|
+
:get,
|
1866
|
+
discord("/guilds/#{guild_id}/members/#{user_id}"),
|
1867
|
+
headers: auditlog(reason)
|
1868
|
+
)
|
1261
1869
|
end
|
1262
1870
|
|
1263
1871
|
##
|
1264
|
-
# @
|
1872
|
+
# @macro pGuildID
|
1265
1873
|
# @macro pQuery
|
1874
|
+
# @macro pReason
|
1266
1875
|
# @macro rResponse
|
1267
1876
|
#
|
1268
1877
|
# @see https://discord.com/developers/docs/resources/guild#list-guild-members
|
1269
1878
|
# Discord documentation "List Guild Members"
|
1270
|
-
def list_guild_members(guild_id, query = {})
|
1271
|
-
json_request(
|
1879
|
+
def list_guild_members(guild_id, query = {}, reason: nil)
|
1880
|
+
json_request(
|
1881
|
+
:get,
|
1882
|
+
discord("/guilds/#{guild_id}/members"),
|
1883
|
+
query:,
|
1884
|
+
headers: auditlog(reason)
|
1885
|
+
)
|
1272
1886
|
end
|
1273
1887
|
|
1274
1888
|
##
|
1275
|
-
# @
|
1889
|
+
# @macro pGuildID
|
1276
1890
|
# @macro pQuery
|
1891
|
+
# @macro pReason
|
1277
1892
|
# @macro rResponse
|
1278
1893
|
#
|
1279
1894
|
# @see https://discord.com/developers/docs/resources/guild#search-guild-members
|
1280
1895
|
# Discord documentation "Search Guild Members"
|
1281
|
-
def search_guild_members(guild_id, query = {})
|
1282
|
-
json_request(
|
1896
|
+
def search_guild_members(guild_id, query = {}, reason: nil)
|
1897
|
+
json_request(
|
1898
|
+
:get,
|
1899
|
+
discord("/guilds/#{guild_id}/members/search"),
|
1900
|
+
query:,
|
1901
|
+
headers: auditlog(reason)
|
1902
|
+
)
|
1283
1903
|
end
|
1284
1904
|
|
1285
1905
|
##
|
1286
|
-
# @
|
1287
|
-
# @
|
1906
|
+
# @macro pGuildID
|
1907
|
+
# @macro pUserID
|
1288
1908
|
# @macro pBody
|
1909
|
+
# @macro pReason
|
1289
1910
|
# @macro rResponse
|
1290
1911
|
#
|
1291
1912
|
# @see https://discord.com/developers/docs/resources/guild#add-guild-member
|
1292
1913
|
# Discord documentation "Add Guild Member"
|
1293
|
-
def add_guild_member(guild_id, user_id, body)
|
1294
|
-
json_request(
|
1914
|
+
def add_guild_member(guild_id, user_id, body, reason: nil)
|
1915
|
+
json_request(
|
1916
|
+
:put,
|
1917
|
+
discord("/guilds/#{guild_id}/members/#{user_id}"),
|
1918
|
+
body:,
|
1919
|
+
headers: auditlog(reason)
|
1920
|
+
)
|
1295
1921
|
end
|
1296
1922
|
|
1297
1923
|
##
|
1298
|
-
# @
|
1299
|
-
# @
|
1924
|
+
# @macro pGuildID
|
1925
|
+
# @macro pUserID
|
1300
1926
|
# @macro pBody
|
1927
|
+
# @macro pReason
|
1301
1928
|
# @macro rResponse
|
1302
1929
|
#
|
1303
1930
|
# @see https://discord.com/developers/docs/resources/guild#modify-guild-member
|
1304
1931
|
# Discord documentation "Modify Guild Member"
|
1305
|
-
def modify_guild_member(guild_id, user_id, body)
|
1306
|
-
json_request(
|
1932
|
+
def modify_guild_member(guild_id, user_id, body, reason: nil)
|
1933
|
+
json_request(
|
1934
|
+
:patch,
|
1935
|
+
discord("/guilds/#{guild_id}/members/#{user_id}"),
|
1936
|
+
body:,
|
1937
|
+
headers: auditlog(reason)
|
1938
|
+
)
|
1307
1939
|
end
|
1308
1940
|
|
1309
1941
|
##
|
1310
|
-
# @
|
1942
|
+
# @macro pGuildID
|
1311
1943
|
# @macro pBody
|
1944
|
+
# @macro pReason
|
1312
1945
|
# @macro rResponse
|
1313
1946
|
#
|
1314
1947
|
# @see https://discord.com/developers/docs/resources/guild#modify-current-member
|
1315
1948
|
# Discord documentation "Modify Current Member"
|
1316
|
-
def modify_current_member(guild_id, body)
|
1317
|
-
json_request(
|
1949
|
+
def modify_current_member(guild_id, body, reason: nil)
|
1950
|
+
json_request(
|
1951
|
+
:patch,
|
1952
|
+
discord("/guilds/#{guild_id}/members/@me"),
|
1953
|
+
body:,
|
1954
|
+
headers: auditlog(reason)
|
1955
|
+
)
|
1318
1956
|
end
|
1319
1957
|
|
1320
1958
|
##
|
1321
1959
|
# @deprecated Use {#modify_current_member} instead.
|
1322
1960
|
#
|
1323
|
-
# @
|
1961
|
+
# @macro pGuildID
|
1324
1962
|
# @macro pBody
|
1963
|
+
# @macro pReason
|
1325
1964
|
# @macro rResponse
|
1326
1965
|
#
|
1327
1966
|
# @see https://discord.com/developers/docs/resources/guild#modify-current-user-nick
|
1328
1967
|
# Discord documentation "Modify Current User Nick"
|
1329
|
-
def modify_current_user_nick(guild_id, body)
|
1330
|
-
json_request(
|
1968
|
+
def modify_current_user_nick(guild_id, body, reason: nil)
|
1969
|
+
json_request(
|
1970
|
+
:patch,
|
1971
|
+
discord("/guilds/#{guild_id}/members/@me/nick"),
|
1972
|
+
body:,
|
1973
|
+
headers: auditlog(reason)
|
1974
|
+
)
|
1331
1975
|
end
|
1332
1976
|
|
1333
1977
|
##
|
1334
|
-
# @
|
1335
|
-
# @
|
1336
|
-
# @
|
1978
|
+
# @macro pGuildID
|
1979
|
+
# @macro pUserID
|
1980
|
+
# @macro pRoleID
|
1981
|
+
# @macro pReason
|
1337
1982
|
# @macro rResponse
|
1338
1983
|
#
|
1339
1984
|
# @see https://discord.com/developers/docs/resources/guild#add-guild-member-role
|
1340
1985
|
# Discord documentation "Add Guild Member Role"
|
1341
|
-
def add_guild_member_role(guild_id, user_id, role_id)
|
1342
|
-
json_request(
|
1986
|
+
def add_guild_member_role(guild_id, user_id, role_id, reason: nil)
|
1987
|
+
json_request(
|
1988
|
+
:put,
|
1989
|
+
discord("/guilds/#{guild_id}/members/#{user_id}/roles/#{role_id}"),
|
1990
|
+
headers: auditlog(reason)
|
1991
|
+
)
|
1343
1992
|
end
|
1344
1993
|
|
1345
1994
|
##
|
1346
|
-
# @
|
1347
|
-
# @
|
1348
|
-
# @
|
1995
|
+
# @macro pGuildID
|
1996
|
+
# @macro pUserID
|
1997
|
+
# @macro pRoleID
|
1998
|
+
# @macro pReason
|
1349
1999
|
# @macro rResponse
|
1350
2000
|
#
|
1351
2001
|
# @see https://discord.com/developers/docs/resources/guild#remove-guild-member-role
|
1352
2002
|
# Discord documentation "Remove Guild Member Role"
|
1353
|
-
def remove_guild_member_role(guild_id, user_id, role_id)
|
1354
|
-
json_request(
|
2003
|
+
def remove_guild_member_role(guild_id, user_id, role_id, reason: nil)
|
2004
|
+
json_request(
|
2005
|
+
:delete,
|
2006
|
+
discord("/guilds/#{guild_id}/members/#{user_id}/roles/#{role_id}"),
|
2007
|
+
headers: auditlog(reason)
|
2008
|
+
)
|
1355
2009
|
end
|
1356
2010
|
|
1357
2011
|
##
|
1358
|
-
# @
|
1359
|
-
# @
|
2012
|
+
# @macro pGuildID
|
2013
|
+
# @macro pUserID
|
2014
|
+
# @macro pReason
|
1360
2015
|
# @macro rResponse
|
1361
2016
|
#
|
1362
2017
|
# @see https://discord.com/developers/docs/resources/guild#remove-guild-member
|
1363
2018
|
# Discord documentation "Remove Guild Member"
|
1364
|
-
def remove_guild_member(guild_id, user_id)
|
1365
|
-
json_request(
|
2019
|
+
def remove_guild_member(guild_id, user_id, reason: nil)
|
2020
|
+
json_request(
|
2021
|
+
:delete,
|
2022
|
+
discord("/guilds/#{guild_id}/members/#{user_id}"),
|
2023
|
+
headers: auditlog(reason)
|
2024
|
+
)
|
1366
2025
|
end
|
1367
2026
|
|
1368
2027
|
##
|
1369
|
-
# @
|
2028
|
+
# @macro pGuildID
|
1370
2029
|
# @macro pQuery
|
2030
|
+
# @macro pReason
|
1371
2031
|
# @macro rResponse
|
1372
2032
|
#
|
1373
2033
|
# @see https://discord.com/developers/docs/resources/guild#get-guild-bans
|
1374
2034
|
# Discord documentation "Get Guild Bans"
|
1375
|
-
def get_guild_bans(guild_id, query = {})
|
1376
|
-
json_request(
|
2035
|
+
def get_guild_bans(guild_id, query = {}, reason: nil)
|
2036
|
+
json_request(
|
2037
|
+
:get,
|
2038
|
+
discord("/guilds/#{guild_id}/bans"),
|
2039
|
+
query:,
|
2040
|
+
headers: auditlog(reason)
|
2041
|
+
)
|
1377
2042
|
end
|
1378
2043
|
|
1379
2044
|
##
|
1380
|
-
# @
|
1381
|
-
# @
|
2045
|
+
# @macro pGuildID
|
2046
|
+
# @macro pUserID
|
2047
|
+
# @macro pReason
|
1382
2048
|
# @macro rResponse
|
1383
2049
|
#
|
1384
2050
|
# @see https://discord.com/developers/docs/resources/guild#get-guild-ban
|
1385
2051
|
# Discord documentation "Get Guild Ban"
|
1386
|
-
def get_guild_ban(guild_id, user_id)
|
1387
|
-
json_request(
|
2052
|
+
def get_guild_ban(guild_id, user_id, reason: nil)
|
2053
|
+
json_request(
|
2054
|
+
:get,
|
2055
|
+
discord("/guilds/#{guild_id}/bans/#{user_id}"),
|
2056
|
+
headers: auditlog(reason)
|
2057
|
+
)
|
1388
2058
|
end
|
1389
2059
|
|
1390
2060
|
##
|
1391
|
-
# @
|
1392
|
-
# @
|
2061
|
+
# @macro pGuildID
|
2062
|
+
# @macro pUserID
|
1393
2063
|
# @macro pBody
|
2064
|
+
# @macro pReason
|
1394
2065
|
# @macro rResponse
|
1395
2066
|
#
|
1396
2067
|
# @see https://discord.com/developers/docs/resources/guild#create-guild-ban
|
1397
2068
|
# Discord documentation "Create Guild Ban"
|
1398
|
-
def create_guild_ban(guild_id, user_id, body)
|
1399
|
-
json_request(
|
2069
|
+
def create_guild_ban(guild_id, user_id, body, reason: nil)
|
2070
|
+
json_request(
|
2071
|
+
:put,
|
2072
|
+
discord("/guilds/#{guild_id}/bans/#{user_id}"),
|
2073
|
+
body:,
|
2074
|
+
headers: auditlog(reason)
|
2075
|
+
)
|
1400
2076
|
end
|
1401
2077
|
|
1402
2078
|
##
|
1403
|
-
# @
|
1404
|
-
# @
|
2079
|
+
# @macro pGuildID
|
2080
|
+
# @macro pUserID
|
2081
|
+
# @macro pReason
|
1405
2082
|
# @macro rResponse
|
1406
2083
|
#
|
1407
2084
|
# @see https://discord.com/developers/docs/resources/guild#remove-guild-ban
|
1408
2085
|
# Discord documentation "Remove Guild Ban"
|
1409
|
-
def remove_guild_ban(guild_id, user_id)
|
1410
|
-
json_request(
|
2086
|
+
def remove_guild_ban(guild_id, user_id, reason: nil)
|
2087
|
+
json_request(
|
2088
|
+
:delete,
|
2089
|
+
discord("/guilds/#{guild_id}/bans/#{user_id}"),
|
2090
|
+
headers: auditlog(reason)
|
2091
|
+
)
|
1411
2092
|
end
|
1412
2093
|
|
1413
2094
|
##
|
1414
|
-
# @
|
2095
|
+
# @macro pGuildID
|
1415
2096
|
# @macro pBody
|
2097
|
+
# @macro pReason
|
1416
2098
|
# @macro rResponse
|
1417
2099
|
#
|
1418
2100
|
# @see https://discord.com/developers/docs/resources/guild#bulk-guild-ban
|
1419
2101
|
# Discord documentation "Bulk Guild Ban"
|
1420
|
-
def bulk_guild_ban(guild_id, body)
|
1421
|
-
json_request(
|
2102
|
+
def bulk_guild_ban(guild_id, body, reason: nil)
|
2103
|
+
json_request(
|
2104
|
+
:post,
|
2105
|
+
discord("/guilds/#{guild_id}/bulk-ban"),
|
2106
|
+
body:,
|
2107
|
+
headers: auditlog(reason)
|
2108
|
+
)
|
1422
2109
|
end
|
1423
2110
|
|
1424
2111
|
##
|
1425
|
-
# @
|
2112
|
+
# @macro pGuildID
|
2113
|
+
# @macro pReason
|
1426
2114
|
# @macro rResponse
|
1427
2115
|
#
|
1428
2116
|
# @see https://discord.com/developers/docs/resources/guild#get-guild-roles
|
1429
2117
|
# Discord documentation "Get Guild Roles"
|
1430
|
-
def get_guild_roles(guild_id)
|
1431
|
-
json_request(
|
2118
|
+
def get_guild_roles(guild_id, reason: nil)
|
2119
|
+
json_request(
|
2120
|
+
:get,
|
2121
|
+
discord("/guilds/#{guild_id}/roles"),
|
2122
|
+
headers: auditlog(reason)
|
2123
|
+
)
|
1432
2124
|
end
|
1433
2125
|
|
1434
2126
|
##
|
1435
|
-
# @
|
1436
|
-
# @
|
2127
|
+
# @macro pGuildID
|
2128
|
+
# @macro pRoleID
|
2129
|
+
# @macro pReason
|
1437
2130
|
# @macro rResponse
|
1438
2131
|
#
|
1439
2132
|
# @see https://discord.com/developers/docs/resources/guild#get-guild-role
|
1440
2133
|
# Discord documentation "Get Guild Role"
|
1441
|
-
def get_guild_role(guild_id, role_id)
|
1442
|
-
json_request(
|
2134
|
+
def get_guild_role(guild_id, role_id, reason: nil)
|
2135
|
+
json_request(
|
2136
|
+
:get,
|
2137
|
+
discord("/guilds/#{guild_id}/roles/#{role_id}"),
|
2138
|
+
headers: auditlog(reason)
|
2139
|
+
)
|
1443
2140
|
end
|
1444
2141
|
|
1445
2142
|
##
|
1446
|
-
# @
|
2143
|
+
# @macro pGuildID
|
1447
2144
|
# @macro pBody
|
2145
|
+
# @macro pReason
|
1448
2146
|
# @macro rResponse
|
1449
2147
|
#
|
1450
2148
|
# @see https://discord.com/developers/docs/resources/guild#create-guild-role
|
1451
2149
|
# Discord documentation "Create Guild Role"
|
1452
|
-
def create_guild_role(guild_id, body)
|
1453
|
-
json_request(
|
2150
|
+
def create_guild_role(guild_id, body, reason: nil)
|
2151
|
+
json_request(
|
2152
|
+
:post,
|
2153
|
+
discord("/guilds/#{guild_id}/roles"),
|
2154
|
+
body:,
|
2155
|
+
headers: auditlog(reason)
|
2156
|
+
)
|
1454
2157
|
end
|
1455
2158
|
|
1456
2159
|
##
|
1457
|
-
# @
|
2160
|
+
# @macro pGuildID
|
1458
2161
|
# @macro pBody
|
2162
|
+
# @macro pReason
|
1459
2163
|
# @macro rResponse
|
1460
2164
|
#
|
1461
2165
|
# @see https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
|
1462
2166
|
# Discord documentation "Modify Guild Role Positions"
|
1463
|
-
def modify_guild_role_positions(guild_id, body)
|
1464
|
-
json_request(
|
2167
|
+
def modify_guild_role_positions(guild_id, body, reason: nil)
|
2168
|
+
json_request(
|
2169
|
+
:patch,
|
2170
|
+
discord("/guilds/#{guild_id}/roles"),
|
2171
|
+
body:,
|
2172
|
+
headers: auditlog(reason)
|
2173
|
+
)
|
1465
2174
|
end
|
1466
2175
|
|
1467
2176
|
##
|
1468
|
-
# @
|
1469
|
-
# @
|
2177
|
+
# @macro pGuildID
|
2178
|
+
# @macro pRoleID
|
1470
2179
|
# @macro pBody
|
2180
|
+
# @macro pReason
|
1471
2181
|
# @macro rResponse
|
1472
2182
|
#
|
1473
2183
|
# @see https://discord.com/developers/docs/resources/guild#modify-guild-role
|
1474
2184
|
# Discord documentation "Modify Guild Role"
|
1475
|
-
def modify_guild_role(guild_id, role_id, body)
|
1476
|
-
json_request(
|
2185
|
+
def modify_guild_role(guild_id, role_id, body, reason: nil)
|
2186
|
+
json_request(
|
2187
|
+
:patch,
|
2188
|
+
discord("/guilds/#{guild_id}/roles/#{role_id}"),
|
2189
|
+
body:,
|
2190
|
+
headers: auditlog(reason)
|
2191
|
+
)
|
1477
2192
|
end
|
1478
2193
|
|
1479
2194
|
##
|
1480
|
-
# @
|
2195
|
+
# @macro pGuildID
|
1481
2196
|
# @macro pBody
|
2197
|
+
# @macro pReason
|
1482
2198
|
# @macro rResponse
|
1483
2199
|
#
|
1484
2200
|
# @see https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level
|
1485
2201
|
# Discord documentation "Modify Guild MFA level"
|
1486
|
-
def modify_guild_mfa_level(guild_id, body)
|
1487
|
-
json_request(
|
2202
|
+
def modify_guild_mfa_level(guild_id, body, reason: nil)
|
2203
|
+
json_request(
|
2204
|
+
:post,
|
2205
|
+
discord("/guilds/#{guild_id}/mfa"),
|
2206
|
+
body:,
|
2207
|
+
headers: auditlog(reason)
|
2208
|
+
)
|
1488
2209
|
end
|
1489
2210
|
|
1490
2211
|
##
|
1491
|
-
# @
|
1492
|
-
# @
|
2212
|
+
# @macro pGuildID
|
2213
|
+
# @macro pRoleID
|
2214
|
+
# @macro pReason
|
1493
2215
|
# @macro rResponse
|
1494
2216
|
#
|
1495
2217
|
# @see https://discord.com/developers/docs/resources/guild#delete-guild-role
|
1496
2218
|
# Discord documentation "Delete Guild Role"
|
1497
|
-
def delete_guild_role(guild_id, role_id)
|
1498
|
-
json_request(
|
2219
|
+
def delete_guild_role(guild_id, role_id, reason: nil)
|
2220
|
+
json_request(
|
2221
|
+
:delete,
|
2222
|
+
discord("/guilds/#{guild_id}/roles/#{role_id}"),
|
2223
|
+
headers: auditlog(reason)
|
2224
|
+
)
|
1499
2225
|
end
|
1500
2226
|
|
1501
2227
|
##
|
1502
|
-
# @
|
2228
|
+
# @macro pGuildID
|
1503
2229
|
# @macro pQuery
|
2230
|
+
# @macro pReason
|
1504
2231
|
# @macro rResponse
|
1505
2232
|
#
|
1506
2233
|
# @see https://discord.com/developers/docs/resources/guild#get-guild-prune-count
|
1507
2234
|
# Discord documentation "Get Guild Prune Count"
|
1508
|
-
def get_guild_prune_count(guild_id, query = {})
|
1509
|
-
json_request(
|
2235
|
+
def get_guild_prune_count(guild_id, query = {}, reason: nil)
|
2236
|
+
json_request(
|
2237
|
+
:get,
|
2238
|
+
discord("/guilds/#{guild_id}/prune"),
|
2239
|
+
query:,
|
2240
|
+
headers: auditlog(reason)
|
2241
|
+
)
|
1510
2242
|
end
|
1511
2243
|
|
1512
2244
|
##
|
1513
|
-
# @
|
2245
|
+
# @macro pGuildID
|
1514
2246
|
# @macro pBody
|
2247
|
+
# @macro pReason
|
1515
2248
|
# @macro rResponse
|
1516
2249
|
#
|
1517
2250
|
# @see https://discord.com/developers/docs/resources/guild#begin-guild-prune
|
1518
2251
|
# Discord documentation "Begin Guild Prune"
|
1519
|
-
def begin_guild_prune(guild_id, body)
|
1520
|
-
json_request(
|
2252
|
+
def begin_guild_prune(guild_id, body, reason: nil)
|
2253
|
+
json_request(
|
2254
|
+
:post,
|
2255
|
+
discord("/guilds/#{guild_id}/prune"),
|
2256
|
+
body:,
|
2257
|
+
headers: auditlog(reason)
|
2258
|
+
)
|
1521
2259
|
end
|
1522
2260
|
|
1523
2261
|
##
|
1524
|
-
# @
|
2262
|
+
# @macro pGuildID
|
2263
|
+
# @macro pReason
|
1525
2264
|
# @macro rResponse
|
1526
2265
|
#
|
1527
2266
|
# @see https://discord.com/developers/docs/resources/guild#get-guild-voice-regions
|
1528
2267
|
# Discord documentation "Get Guild Voice Regions"
|
1529
|
-
def get_guild_voice_regions(guild_id)
|
1530
|
-
json_request(
|
2268
|
+
def get_guild_voice_regions(guild_id, reason: nil)
|
2269
|
+
json_request(
|
2270
|
+
:get,
|
2271
|
+
discord("/guilds/#{guild_id}/regions"),
|
2272
|
+
headers: auditlog(reason)
|
2273
|
+
)
|
1531
2274
|
end
|
1532
2275
|
|
1533
2276
|
##
|
1534
|
-
# @
|
2277
|
+
# @macro pGuildID
|
2278
|
+
# @macro pReason
|
1535
2279
|
# @macro rResponse
|
1536
2280
|
#
|
1537
2281
|
# @see https://discord.com/developers/docs/resources/guild#get-guild-invites
|
1538
2282
|
# Discord documentation "Get Guild Invites"
|
1539
|
-
def get_guild_invites(guild_id)
|
1540
|
-
json_request(
|
2283
|
+
def get_guild_invites(guild_id, reason: nil)
|
2284
|
+
json_request(
|
2285
|
+
:get,
|
2286
|
+
discord("/guilds/#{guild_id}/invites"),
|
2287
|
+
headers: auditlog(reason)
|
2288
|
+
)
|
1541
2289
|
end
|
1542
2290
|
|
1543
2291
|
##
|
1544
|
-
# @
|
2292
|
+
# @macro pGuildID
|
2293
|
+
# @macro pReason
|
1545
2294
|
# @macro rResponse
|
1546
2295
|
#
|
1547
2296
|
# @see https://discord.com/developers/docs/resources/guild#get-guild-integrations
|
1548
2297
|
# Discord documentation "Get Guild Integrations"
|
1549
|
-
def get_guild_integrations(guild_id)
|
1550
|
-
json_request(
|
2298
|
+
def get_guild_integrations(guild_id, reason: nil)
|
2299
|
+
json_request(
|
2300
|
+
:get,
|
2301
|
+
discord("/guilds/#{guild_id}/integrations"),
|
2302
|
+
headers: auditlog(reason)
|
2303
|
+
)
|
1551
2304
|
end
|
1552
2305
|
|
1553
2306
|
##
|
1554
|
-
# @
|
1555
|
-
# @
|
2307
|
+
# @macro pGuildID
|
2308
|
+
# @macro pIntegrationID
|
2309
|
+
# @macro pReason
|
1556
2310
|
# @macro rResponse
|
1557
2311
|
#
|
1558
2312
|
# @see https://discord.com/developers/docs/resources/guild#delete-guild-integration
|
1559
2313
|
# Discord documentation "Delete Guild Integration"
|
1560
|
-
def delete_guild_integration(guild_id, integration_id)
|
1561
|
-
json_request(
|
2314
|
+
def delete_guild_integration(guild_id, integration_id, reason: nil)
|
2315
|
+
json_request(
|
2316
|
+
:delete,
|
2317
|
+
discord("/guilds/#{guild_id}/integrations/#{integration_id}"),
|
2318
|
+
headers: auditlog(reason)
|
2319
|
+
)
|
1562
2320
|
end
|
1563
2321
|
|
1564
2322
|
##
|
1565
|
-
# @
|
2323
|
+
# @macro pGuildID
|
2324
|
+
# @macro pReason
|
1566
2325
|
# @macro rResponse
|
1567
2326
|
#
|
1568
2327
|
# @see https://discord.com/developers/docs/resources/guild#get-guild-widget-settings
|
1569
2328
|
# Discord documentation "Get Guild Widget Settings"
|
1570
|
-
def get_guild_widget_settings(guild_id)
|
1571
|
-
json_request(
|
2329
|
+
def get_guild_widget_settings(guild_id, reason: nil)
|
2330
|
+
json_request(
|
2331
|
+
:get,
|
2332
|
+
discord("/guilds/#{guild_id}/widget"),
|
2333
|
+
headers: auditlog(reason)
|
2334
|
+
)
|
1572
2335
|
end
|
1573
2336
|
|
1574
2337
|
##
|
1575
|
-
# @
|
2338
|
+
# @macro pGuildID
|
1576
2339
|
# @macro pBody
|
2340
|
+
# @macro pReason
|
1577
2341
|
# @macro rResponse
|
1578
2342
|
#
|
1579
2343
|
# @see https://discord.com/developers/docs/resources/guild#modify-guild-widget
|
1580
2344
|
# Discord documentation "Modify Guild Widget"
|
1581
|
-
def modify_guild_widget(guild_id, body)
|
1582
|
-
json_request(
|
2345
|
+
def modify_guild_widget(guild_id, body, reason: nil)
|
2346
|
+
json_request(
|
2347
|
+
:patch,
|
2348
|
+
discord("/guilds/#{guild_id}/widget"),
|
2349
|
+
body:,
|
2350
|
+
headers: auditlog(reason)
|
2351
|
+
)
|
1583
2352
|
end
|
1584
2353
|
|
1585
2354
|
##
|
1586
|
-
# @
|
2355
|
+
# @macro pGuildID
|
2356
|
+
# @macro pReason
|
1587
2357
|
# @macro rResponse
|
1588
2358
|
#
|
1589
2359
|
# @see https://discord.com/developers/docs/resources/guild#get-guild-widget
|
1590
2360
|
# Discord documentation "Get Guild Widget"
|
1591
|
-
def get_guild_widget(guild_id)
|
1592
|
-
json_request(
|
2361
|
+
def get_guild_widget(guild_id, reason: nil)
|
2362
|
+
json_request(
|
2363
|
+
:get,
|
2364
|
+
discord("/guilds/#{guild_id}/widget.json"),
|
2365
|
+
headers: auditlog(reason)
|
2366
|
+
)
|
1593
2367
|
end
|
1594
2368
|
|
1595
2369
|
##
|
1596
|
-
# @
|
2370
|
+
# @macro pGuildID
|
2371
|
+
# @macro pReason
|
1597
2372
|
# @macro rResponse
|
1598
2373
|
#
|
1599
2374
|
# @see https://discord.com/developers/docs/resources/guild#get-guild-vanity-url
|
1600
2375
|
# Discord documentation "Get Guild Vanity URL"
|
1601
|
-
def get_guild_vanity_url(guild_id)
|
1602
|
-
json_request(
|
2376
|
+
def get_guild_vanity_url(guild_id, reason: nil)
|
2377
|
+
json_request(
|
2378
|
+
:get,
|
2379
|
+
discord("/guilds/#{guild_id}/vanity-url"),
|
2380
|
+
headers: auditlog(reason)
|
2381
|
+
)
|
1603
2382
|
end
|
1604
2383
|
|
1605
2384
|
##
|
1606
|
-
# @
|
2385
|
+
# @macro pGuildID
|
1607
2386
|
# @macro pQuery
|
2387
|
+
# @macro pReason
|
1608
2388
|
# @macro rResponse
|
1609
2389
|
#
|
1610
2390
|
# @see https://discord.com/developers/docs/resources/guild#get-guild-widget-image
|
1611
2391
|
# Discord documentation "Get Guild Widget Image"
|
1612
|
-
def get_guild_widget_image(guild_id, query = {})
|
1613
|
-
net_request(
|
2392
|
+
def get_guild_widget_image(guild_id, query = {}, reason: nil)
|
2393
|
+
net_request(
|
2394
|
+
:get,
|
2395
|
+
discord("/guilds/#{guild_id}/widget.png"),
|
2396
|
+
query:,
|
2397
|
+
headers: auditlog(reason)
|
2398
|
+
)
|
1614
2399
|
end
|
1615
2400
|
|
1616
2401
|
##
|
1617
|
-
# @
|
2402
|
+
# @macro pGuildID
|
2403
|
+
# @macro pReason
|
1618
2404
|
# @macro rResponse
|
1619
2405
|
#
|
1620
2406
|
# @see https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen
|
1621
2407
|
# Discord documentation "Get Guild Welcome Screen"
|
1622
|
-
def get_guild_welcome_screen(guild_id)
|
1623
|
-
json_request(
|
2408
|
+
def get_guild_welcome_screen(guild_id, reason: nil)
|
2409
|
+
json_request(
|
2410
|
+
:get,
|
2411
|
+
discord("/guilds/#{guild_id}/welcome-screen"),
|
2412
|
+
headers: auditlog(reason)
|
2413
|
+
)
|
1624
2414
|
end
|
1625
2415
|
|
1626
2416
|
##
|
1627
|
-
# @
|
2417
|
+
# @macro pGuildID
|
1628
2418
|
# @macro pBody
|
2419
|
+
# @macro pReason
|
1629
2420
|
# @macro rResponse
|
1630
2421
|
#
|
1631
2422
|
# @see https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen
|
1632
2423
|
# Discord documentation "Modify Guild Welcome Screen"
|
1633
|
-
def modify_guild_welcome_screen(guild_id, body)
|
1634
|
-
json_request(
|
2424
|
+
def modify_guild_welcome_screen(guild_id, body, reason: nil)
|
2425
|
+
json_request(
|
2426
|
+
:patch,
|
2427
|
+
discord("/guilds/#{guild_id}/welcome-screen"),
|
2428
|
+
body:,
|
2429
|
+
headers: auditlog(reason)
|
2430
|
+
)
|
1635
2431
|
end
|
1636
2432
|
|
1637
2433
|
##
|
1638
|
-
# @
|
2434
|
+
# @macro pGuildID
|
2435
|
+
# @macro pReason
|
1639
2436
|
# @macro rResponse
|
1640
2437
|
#
|
1641
2438
|
# @see https://discord.com/developers/docs/resources/guild#get-guild-onboarding
|
1642
2439
|
# Discord documentation "Get Guild Onboarding"
|
1643
|
-
def get_guild_onboarding(guild_id)
|
1644
|
-
json_request(
|
2440
|
+
def get_guild_onboarding(guild_id, reason: nil)
|
2441
|
+
json_request(
|
2442
|
+
:get,
|
2443
|
+
discord("/guilds/#{guild_id}/onboarding"),
|
2444
|
+
headers: auditlog(reason)
|
2445
|
+
)
|
1645
2446
|
end
|
1646
2447
|
|
1647
2448
|
##
|
1648
|
-
# @
|
2449
|
+
# @macro pGuildID
|
1649
2450
|
# @macro pBody
|
2451
|
+
# @macro pReason
|
1650
2452
|
# @macro rResponse
|
1651
2453
|
#
|
1652
2454
|
# @see https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
|
1653
2455
|
# Discord documentation "Modify Guild Onboarding"
|
1654
|
-
def modify_guild_onboarding(guild_id, body)
|
1655
|
-
json_request(
|
2456
|
+
def modify_guild_onboarding(guild_id, body, reason: nil)
|
2457
|
+
json_request(
|
2458
|
+
:put,
|
2459
|
+
discord("/guilds/#{guild_id}/onboarding"),
|
2460
|
+
body:,
|
2461
|
+
headers: auditlog(reason)
|
2462
|
+
)
|
1656
2463
|
end
|
1657
2464
|
|
1658
2465
|
##
|
1659
|
-
# @
|
2466
|
+
# @macro pGuildID
|
1660
2467
|
# @macro pBody
|
2468
|
+
# @macro pReason
|
1661
2469
|
# @macro rResponse
|
1662
2470
|
#
|
1663
2471
|
# @see https://discord.com/developers/docs/resources/guild#modify-guild-incident-actions
|
1664
2472
|
# Discord documentation "Modify Guild Incident Actions"
|
1665
|
-
def modify_guild_incident_actions(guild_id, body)
|
1666
|
-
json_request(
|
2473
|
+
def modify_guild_incident_actions(guild_id, body, reason: nil)
|
2474
|
+
json_request(
|
2475
|
+
:put,
|
2476
|
+
discord("/guilds/#{guild_id}/incident-actions"),
|
2477
|
+
body:,
|
2478
|
+
headers: auditlog(reason)
|
2479
|
+
)
|
1667
2480
|
end
|
1668
2481
|
|
1669
2482
|
### }}} Guild
|
@@ -1671,24 +2484,35 @@ module LibDiscord
|
|
1671
2484
|
### Invite {{{
|
1672
2485
|
|
1673
2486
|
##
|
1674
|
-
# @
|
2487
|
+
# @macro pInviteCode
|
1675
2488
|
# @macro pQuery
|
2489
|
+
# @macro pReason
|
1676
2490
|
# @macro rResponse
|
1677
2491
|
#
|
1678
2492
|
# @see https://discord.com/developers/docs/resources/invite#get-invite
|
1679
2493
|
# Discord documentation "Get Invite"
|
1680
|
-
def get_invite(invite_code, query = {})
|
1681
|
-
json_request(
|
2494
|
+
def get_invite(invite_code, query = {}, reason: nil)
|
2495
|
+
json_request(
|
2496
|
+
:get,
|
2497
|
+
discord("/invites/#{invite_code}"),
|
2498
|
+
query:,
|
2499
|
+
headers: auditlog(reason)
|
2500
|
+
)
|
1682
2501
|
end
|
1683
2502
|
|
1684
2503
|
##
|
1685
|
-
# @
|
2504
|
+
# @macro pInviteCode
|
2505
|
+
# @macro pReason
|
1686
2506
|
# @macro rResponse
|
1687
2507
|
#
|
1688
2508
|
# @see https://discord.com/developers/docs/resources/invite#delete-invite
|
1689
2509
|
# Discord documentation "Delete Invite"
|
1690
|
-
def delete_invite(invite_code)
|
1691
|
-
json_request(
|
2510
|
+
def delete_invite(invite_code, reason: nil)
|
2511
|
+
json_request(
|
2512
|
+
:delete,
|
2513
|
+
discord("/invites/#{invite_code}"),
|
2514
|
+
headers: auditlog(reason)
|
2515
|
+
)
|
1692
2516
|
end
|
1693
2517
|
|
1694
2518
|
### }}} Invite
|
@@ -1697,97 +2521,146 @@ module LibDiscord
|
|
1697
2521
|
|
1698
2522
|
##
|
1699
2523
|
# @macro pBody
|
2524
|
+
# @macro pReason
|
1700
2525
|
# @macro rResponse
|
1701
2526
|
#
|
1702
2527
|
# @see https://discord.com/developers/docs/resources/lobby#create-lobby
|
1703
2528
|
# Discord documentation "Create Lobby"
|
1704
|
-
def create_lobby(body)
|
1705
|
-
json_request(
|
2529
|
+
def create_lobby(body, reason: nil)
|
2530
|
+
json_request(
|
2531
|
+
:post,
|
2532
|
+
discord("/lobbies"),
|
2533
|
+
body:,
|
2534
|
+
headers: auditlog(reason)
|
2535
|
+
)
|
1706
2536
|
end
|
1707
2537
|
|
1708
2538
|
##
|
1709
|
-
# @
|
2539
|
+
# @macro pLobbyID
|
2540
|
+
# @macro pReason
|
1710
2541
|
# @macro rResponse
|
1711
2542
|
#
|
1712
2543
|
# @see https://discord.com/developers/docs/resources/lobby#get-lobby
|
1713
2544
|
# Discord documentation "Get Lobby"
|
1714
|
-
def get_lobby(lobby_id)
|
1715
|
-
json_request(
|
2545
|
+
def get_lobby(lobby_id, reason: nil)
|
2546
|
+
json_request(
|
2547
|
+
:get,
|
2548
|
+
discord("/lobbies/#{lobby_id}"),
|
2549
|
+
headers: auditlog(reason)
|
2550
|
+
)
|
1716
2551
|
end
|
1717
2552
|
|
1718
2553
|
##
|
1719
|
-
# @
|
2554
|
+
# @macro pLobbyID
|
1720
2555
|
# @macro pBody
|
2556
|
+
# @macro pReason
|
1721
2557
|
# @macro rResponse
|
1722
2558
|
#
|
1723
2559
|
# @see https://discord.com/developers/docs/resources/lobby#modify-lobby
|
1724
2560
|
# Discord documentation "Modify Lobby"
|
1725
|
-
def modify_lobby(lobby_id, body)
|
1726
|
-
json_request(
|
2561
|
+
def modify_lobby(lobby_id, body, reason: nil)
|
2562
|
+
json_request(
|
2563
|
+
:patch,
|
2564
|
+
discord("/lobbies/#{lobby_id}"),
|
2565
|
+
body:,
|
2566
|
+
headers: auditlog(reason)
|
2567
|
+
)
|
1727
2568
|
end
|
1728
2569
|
|
1729
2570
|
##
|
1730
|
-
# @
|
2571
|
+
# @macro pLobbyID
|
2572
|
+
# @macro pReason
|
1731
2573
|
# @macro rResponse
|
1732
2574
|
#
|
1733
2575
|
# @see https://discord.com/developers/docs/resources/lobby#delete-lobby
|
1734
2576
|
# Discord documentation "Delete Lobby"
|
1735
|
-
def delete_lobby(lobby_id)
|
1736
|
-
json_request(
|
2577
|
+
def delete_lobby(lobby_id, reason: nil)
|
2578
|
+
json_request(
|
2579
|
+
:delete,
|
2580
|
+
discord("/lobbies/#{lobby_id}"),
|
2581
|
+
headers: auditlog(reason)
|
2582
|
+
)
|
1737
2583
|
end
|
1738
2584
|
|
1739
2585
|
##
|
1740
|
-
# @
|
1741
|
-
# @
|
2586
|
+
# @macro pLobbyID
|
2587
|
+
# @macro pUserID
|
1742
2588
|
# @macro pBody
|
2589
|
+
# @macro pReason
|
1743
2590
|
# @macro rResponse
|
1744
2591
|
#
|
1745
2592
|
# @see https://discord.com/developers/docs/resources/lobby#add-a-member-to-a-lobby
|
1746
2593
|
# Discord documentation "Add a Member to a Lobby"
|
1747
|
-
def add_member_to_lobby(lobby_id, user_id, body
|
1748
|
-
json_request(
|
2594
|
+
def add_member_to_lobby(lobby_id, user_id, body, reason: nil)
|
2595
|
+
json_request(
|
2596
|
+
:put,
|
2597
|
+
discord("/lobbies/#{lobby_id}/members/#{user_id}"),
|
2598
|
+
body:,
|
2599
|
+
headers: auditlog(reason)
|
2600
|
+
)
|
1749
2601
|
end
|
1750
2602
|
|
1751
2603
|
##
|
1752
|
-
# @
|
1753
|
-
# @
|
2604
|
+
# @macro pLobbyID
|
2605
|
+
# @macro pUserID
|
2606
|
+
# @macro pReason
|
1754
2607
|
# @macro rResponse
|
1755
2608
|
#
|
1756
2609
|
# @see https://discord.com/developers/docs/resources/lobby#remove-a-member-from-a-lobby
|
1757
2610
|
# Discord documentation "Remove a Member from a Lobby"
|
1758
|
-
def remove_member_from_lobby(lobby_id, user_id)
|
1759
|
-
json_request(
|
2611
|
+
def remove_member_from_lobby(lobby_id, user_id, reason: nil)
|
2612
|
+
json_request(
|
2613
|
+
:delete,
|
2614
|
+
discord("/lobbies/#{lobby_id}/members/#{user_id}"),
|
2615
|
+
headers: auditlog(reason)
|
2616
|
+
)
|
1760
2617
|
end
|
1761
2618
|
|
1762
2619
|
##
|
1763
|
-
# @
|
2620
|
+
# @macro pLobbyID
|
2621
|
+
# @macro pReason
|
1764
2622
|
# @macro rResponse
|
1765
2623
|
#
|
1766
2624
|
# @see https://discord.com/developers/docs/resources/lobby#leave-lobby
|
1767
2625
|
# Discord documentation "Leave Lobby"
|
1768
|
-
def leave_lobby(lobby_id)
|
1769
|
-
json_request(
|
2626
|
+
def leave_lobby(lobby_id, reason: nil)
|
2627
|
+
json_request(
|
2628
|
+
:delete,
|
2629
|
+
discord("/lobbies/#{lobby_id}/members/@me"),
|
2630
|
+
headers: auditlog(reason)
|
2631
|
+
)
|
1770
2632
|
end
|
1771
2633
|
|
1772
2634
|
##
|
1773
|
-
# @
|
2635
|
+
# @macro pLobbyID
|
1774
2636
|
# @macro pBody
|
2637
|
+
# @macro pReason
|
1775
2638
|
# @macro rResponse
|
1776
2639
|
#
|
1777
2640
|
# @see https://discord.com/developers/docs/resources/lobby#link-channel-to-lobby
|
1778
2641
|
# Discord documentation "Link Channel to Lobby"
|
1779
|
-
def link_channel_to_lobby(lobby_id, body)
|
1780
|
-
json_request(
|
2642
|
+
def link_channel_to_lobby(lobby_id, body, reason: nil)
|
2643
|
+
json_request(
|
2644
|
+
:patch,
|
2645
|
+
discord("/lobbies/#{lobby_id}/channel-linking"),
|
2646
|
+
body:,
|
2647
|
+
headers: auditlog(reason)
|
2648
|
+
)
|
1781
2649
|
end
|
1782
2650
|
|
1783
2651
|
##
|
1784
|
-
# @
|
2652
|
+
# @macro pLobbyID
|
2653
|
+
# @macro pReason
|
1785
2654
|
# @macro rResponse
|
1786
2655
|
#
|
1787
2656
|
# @see https://discord.com/developers/docs/resources/lobby#unlink-channel-from-lobby
|
1788
2657
|
# Discord documentation "Unlink Channel from Lobby"
|
1789
|
-
def unlink_channel_from_lobby(lobby_id)
|
1790
|
-
json_request(
|
2658
|
+
def unlink_channel_from_lobby(lobby_id, reason: nil)
|
2659
|
+
json_request(
|
2660
|
+
:patch,
|
2661
|
+
discord("/lobbies/#{lobby_id}/channel-linking"),
|
2662
|
+
headers: auditlog(reason)
|
2663
|
+
)
|
1791
2664
|
end
|
1792
2665
|
|
1793
2666
|
### }}} Lobby
|
@@ -1795,155 +2668,224 @@ module LibDiscord
|
|
1795
2668
|
### Message {{{
|
1796
2669
|
|
1797
2670
|
##
|
1798
|
-
# @
|
2671
|
+
# @macro pChannelID
|
1799
2672
|
# @macro pQuery
|
2673
|
+
# @macro pReason
|
1800
2674
|
# @macro rResponse
|
1801
2675
|
#
|
1802
2676
|
# @see https://discord.com/developers/docs/resources/message#get-channel-messages
|
1803
2677
|
# Discord documentation "Get Channel Messages"
|
1804
|
-
def get_channel_messages(channel_id, query = {})
|
1805
|
-
json_request(
|
2678
|
+
def get_channel_messages(channel_id, query = {}, reason: nil)
|
2679
|
+
json_request(
|
2680
|
+
:get,
|
2681
|
+
discord("/channels/#{channel_id}/messages"),
|
2682
|
+
query:,
|
2683
|
+
headers: auditlog(reason)
|
2684
|
+
)
|
1806
2685
|
end
|
1807
2686
|
|
1808
2687
|
##
|
1809
|
-
# @
|
1810
|
-
# @
|
2688
|
+
# @macro pChannelID
|
2689
|
+
# @macro pMessageID
|
2690
|
+
# @macro pReason
|
1811
2691
|
# @macro rResponse
|
1812
2692
|
#
|
1813
2693
|
# @see https://discord.com/developers/docs/resources/message#get-channel-message
|
1814
2694
|
# Discord documentation "Get Channel Message"
|
1815
|
-
def get_channel_message(channel_id, message_id)
|
1816
|
-
json_request(
|
2695
|
+
def get_channel_message(channel_id, message_id, reason: nil)
|
2696
|
+
json_request(
|
2697
|
+
:get,
|
2698
|
+
discord("/channels/#{channel_id}/messages/#{message_id}"),
|
2699
|
+
headers: auditlog(reason)
|
2700
|
+
)
|
1817
2701
|
end
|
1818
2702
|
|
1819
2703
|
##
|
1820
|
-
# @
|
2704
|
+
# @macro pChannelID
|
1821
2705
|
# @macro pBody
|
2706
|
+
# @macro pReason
|
1822
2707
|
# @macro rResponse
|
1823
2708
|
#
|
1824
2709
|
# @see https://discord.com/developers/docs/resources/message#create-message
|
1825
2710
|
# Discord documentation "Create Message"
|
1826
|
-
def create_message(channel_id, body)
|
1827
|
-
json_request(
|
2711
|
+
def create_message(channel_id, body, reason: nil)
|
2712
|
+
json_request(
|
2713
|
+
:post,
|
2714
|
+
discord("/channels/#{channel_id}/messages"),
|
2715
|
+
body:,
|
2716
|
+
headers: auditlog(reason)
|
2717
|
+
)
|
1828
2718
|
end
|
1829
2719
|
|
1830
2720
|
##
|
1831
|
-
# @
|
1832
|
-
# @
|
1833
|
-
#
|
2721
|
+
# @macro pChannelID
|
2722
|
+
# @macro pMessageID
|
2723
|
+
# @macro pReason
|
1834
2724
|
# @macro rResponse
|
1835
2725
|
#
|
1836
2726
|
# @see https://discord.com/developers/docs/resources/message#crosspost-message
|
1837
2727
|
# Discord documentation "Crosspost Message"
|
1838
|
-
def crosspost_message(channel_id, message_id)
|
1839
|
-
json_request(
|
2728
|
+
def crosspost_message(channel_id, message_id, reason: nil)
|
2729
|
+
json_request(
|
2730
|
+
:post,
|
2731
|
+
discord("/channels/#{channel_id}/messages/#{message_id}/crosspost"),
|
2732
|
+
headers: auditlog(reason)
|
2733
|
+
)
|
1840
2734
|
end
|
1841
2735
|
|
1842
2736
|
##
|
1843
|
-
# @
|
1844
|
-
# @
|
1845
|
-
# @
|
2737
|
+
# @macro pChannelID
|
2738
|
+
# @macro pMessageID
|
2739
|
+
# @macro pEmoji
|
2740
|
+
# @macro pReason
|
1846
2741
|
# @macro rResponse
|
1847
2742
|
#
|
1848
2743
|
# @see https://discord.com/developers/docs/resources/message#create-reaction
|
1849
2744
|
# Discord documentation "Create Reaction"
|
1850
|
-
def create_reaction(channel_id, message_id, emoji)
|
1851
|
-
json_request(
|
2745
|
+
def create_reaction(channel_id, message_id, emoji, reason: nil)
|
2746
|
+
json_request(
|
2747
|
+
:put,
|
2748
|
+
discord("/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}/@me"),
|
2749
|
+
headers: auditlog(reason)
|
2750
|
+
)
|
1852
2751
|
end
|
1853
2752
|
|
1854
2753
|
##
|
1855
|
-
# @
|
1856
|
-
# @
|
1857
|
-
# @
|
2754
|
+
# @macro pChannelID
|
2755
|
+
# @macro pMessageID
|
2756
|
+
# @macro pEmoji
|
2757
|
+
# @macro pReason
|
1858
2758
|
# @macro rResponse
|
1859
2759
|
#
|
1860
2760
|
# @see https://discord.com/developers/docs/resources/message#delete-own-reaction
|
1861
2761
|
# Discord documentation "Delete Own Reaction"
|
1862
|
-
def delete_own_reaction(channel_id, message_id, emoji)
|
1863
|
-
json_request(
|
2762
|
+
def delete_own_reaction(channel_id, message_id, emoji, reason: nil)
|
2763
|
+
json_request(
|
2764
|
+
:delete,
|
2765
|
+
discord("/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}/@me"),
|
2766
|
+
headers: auditlog(reason)
|
2767
|
+
)
|
1864
2768
|
end
|
1865
2769
|
|
1866
2770
|
##
|
1867
|
-
# @
|
1868
|
-
# @
|
1869
|
-
# @
|
1870
|
-
# @
|
2771
|
+
# @macro pChannelID
|
2772
|
+
# @macro pMessageID
|
2773
|
+
# @macro pEmoji
|
2774
|
+
# @macro pUserID
|
2775
|
+
# @macro pReason
|
1871
2776
|
# @macro rResponse
|
1872
2777
|
#
|
1873
2778
|
# @see https://discord.com/developers/docs/resources/message#delete-user-reaction
|
1874
2779
|
# Discord documentation "Delete User Reaction"
|
1875
|
-
def delete_user_reaction(channel_id, message_id, emoji, user_id)
|
1876
|
-
json_request(
|
2780
|
+
def delete_user_reaction(channel_id, message_id, emoji, user_id, reason: nil)
|
2781
|
+
json_request(
|
2782
|
+
:delete,
|
2783
|
+
discord("/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}/#{user_id}"),
|
2784
|
+
headers: auditlog(reason)
|
2785
|
+
)
|
1877
2786
|
end
|
1878
2787
|
|
1879
2788
|
##
|
1880
|
-
# @
|
1881
|
-
# @
|
1882
|
-
# @
|
2789
|
+
# @macro pChannelID
|
2790
|
+
# @macro pMessageID
|
2791
|
+
# @macro pEmoji
|
1883
2792
|
# @macro pQuery
|
2793
|
+
# @macro pReason
|
1884
2794
|
# @macro rResponse
|
1885
2795
|
#
|
1886
2796
|
# @see https://discord.com/developers/docs/resources/message#get-reactions
|
1887
2797
|
# Discord documentation "Get Reactions"
|
1888
|
-
def get_reactions(channel_id, message_id, emoji, query = {})
|
1889
|
-
json_request(
|
2798
|
+
def get_reactions(channel_id, message_id, emoji, query = {}, reason: nil)
|
2799
|
+
json_request(
|
2800
|
+
:get,
|
2801
|
+
discord("/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}"),
|
2802
|
+
query:,
|
2803
|
+
headers: auditlog(reason)
|
2804
|
+
)
|
1890
2805
|
end
|
1891
2806
|
|
1892
2807
|
##
|
1893
|
-
# @
|
1894
|
-
# @
|
2808
|
+
# @macro pChannelID
|
2809
|
+
# @macro pMessageID
|
2810
|
+
# @macro pReason
|
1895
2811
|
# @macro rResponse
|
1896
2812
|
#
|
1897
2813
|
# @see https://discord.com/developers/docs/resources/message#delete-all-reactions
|
1898
2814
|
# Discord documentation "Delete All Reactions"
|
1899
|
-
def delete_all_reactions(channel_id, message_id)
|
1900
|
-
json_request(
|
2815
|
+
def delete_all_reactions(channel_id, message_id, reason: nil)
|
2816
|
+
json_request(
|
2817
|
+
:delete,
|
2818
|
+
discord("/channels/#{channel_id}/messages/#{message_id}/reactions"),
|
2819
|
+
headers: auditlog(reason)
|
2820
|
+
)
|
1901
2821
|
end
|
1902
2822
|
|
1903
2823
|
##
|
1904
|
-
# @
|
1905
|
-
# @
|
1906
|
-
# @
|
2824
|
+
# @macro pChannelID
|
2825
|
+
# @macro pMessageID
|
2826
|
+
# @macro pEmoji
|
2827
|
+
# @macro pReason
|
1907
2828
|
# @macro rResponse
|
1908
2829
|
#
|
1909
2830
|
# @see https://discord.com/developers/docs/resources/message#delete-all-reactions-for-emoji
|
1910
2831
|
# Discord documentation "Delete All Reactions for Emoji"
|
1911
|
-
def delete_all_reactions_for_emoji(channel_id, message_id, emoji)
|
1912
|
-
json_request(
|
2832
|
+
def delete_all_reactions_for_emoji(channel_id, message_id, emoji, reason: nil)
|
2833
|
+
json_request(
|
2834
|
+
:delete,
|
2835
|
+
discord("/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}"),
|
2836
|
+
headers: auditlog(reason)
|
2837
|
+
)
|
1913
2838
|
end
|
1914
2839
|
|
1915
2840
|
##
|
1916
|
-
# @
|
1917
|
-
# @
|
2841
|
+
# @macro pChannelID
|
2842
|
+
# @macro pMessageID
|
1918
2843
|
# @macro pBody
|
2844
|
+
# @macro pReason
|
1919
2845
|
# @macro rResponse
|
1920
2846
|
#
|
1921
2847
|
# @see https://discord.com/developers/docs/resources/message#edit-message
|
1922
2848
|
# Discord documentation "Edit Message"
|
1923
|
-
def edit_message(channel_id, message_id, body)
|
1924
|
-
json_request(
|
2849
|
+
def edit_message(channel_id, message_id, body, reason: nil)
|
2850
|
+
json_request(
|
2851
|
+
:patch,
|
2852
|
+
discord("/channels/#{channel_id}/messages/#{message_id}"),
|
2853
|
+
body:,
|
2854
|
+
headers: auditlog(reason)
|
2855
|
+
)
|
1925
2856
|
end
|
1926
2857
|
|
1927
2858
|
##
|
1928
|
-
# @
|
1929
|
-
# @
|
2859
|
+
# @macro pChannelID
|
2860
|
+
# @macro pMessageID
|
2861
|
+
# @macro pReason
|
1930
2862
|
# @macro rResponse
|
1931
2863
|
#
|
1932
2864
|
# @see https://discord.com/developers/docs/resources/message#delete-message
|
1933
2865
|
# Discord documentation "Delete Message"
|
1934
|
-
def delete_message(channel_id, message_id)
|
1935
|
-
json_request(
|
2866
|
+
def delete_message(channel_id, message_id, reason: nil)
|
2867
|
+
json_request(
|
2868
|
+
:delete,
|
2869
|
+
discord("/channels/#{channel_id}/messages/#{message_id}"),
|
2870
|
+
headers: auditlog(reason)
|
2871
|
+
)
|
1936
2872
|
end
|
1937
2873
|
|
1938
2874
|
##
|
1939
|
-
# @
|
2875
|
+
# @macro pChannelID
|
1940
2876
|
# @macro pBody
|
2877
|
+
# @macro pReason
|
1941
2878
|
# @macro rResponse
|
1942
2879
|
#
|
1943
2880
|
# @see https://discord.com/developers/docs/resources/message#bulk-delete-messages
|
1944
2881
|
# Discord documentation "Bulk Delete Messages"
|
1945
|
-
def bulk_delete_messages(channel_id, body)
|
1946
|
-
json_request(
|
2882
|
+
def bulk_delete_messages(channel_id, body, reason: nil)
|
2883
|
+
json_request(
|
2884
|
+
:post,
|
2885
|
+
discord("/channels/#{channel_id}/messages/bulk-delete"),
|
2886
|
+
body:,
|
2887
|
+
headers: auditlog(reason)
|
2888
|
+
)
|
1947
2889
|
end
|
1948
2890
|
|
1949
2891
|
### }}} Message
|
@@ -1951,27 +2893,38 @@ module LibDiscord
|
|
1951
2893
|
### Poll {{{
|
1952
2894
|
|
1953
2895
|
##
|
1954
|
-
# @
|
1955
|
-
# @
|
1956
|
-
# @
|
2896
|
+
# @macro pChannelID
|
2897
|
+
# @macro pMessageID
|
2898
|
+
# @macro pAnswerID
|
1957
2899
|
# @macro pQuery
|
2900
|
+
# @macro pReason
|
1958
2901
|
# @macro rResponse
|
1959
2902
|
#
|
1960
2903
|
# @see https://discord.com/developers/docs/resources/poll#get-answer-voters
|
1961
2904
|
# Discord documentation "Get Answer Voters"
|
1962
|
-
def get_answer_voters(channel_id, message_id, answer_id, query = {})
|
1963
|
-
json_request(
|
2905
|
+
def get_answer_voters(channel_id, message_id, answer_id, query = {}, reason: nil)
|
2906
|
+
json_request(
|
2907
|
+
:get,
|
2908
|
+
discord("/channels/#{channel_id}/polls/#{message_id}/answers/#{answer_id}"),
|
2909
|
+
query:,
|
2910
|
+
headers: auditlog(reason)
|
2911
|
+
)
|
1964
2912
|
end
|
1965
2913
|
|
1966
2914
|
##
|
1967
|
-
# @
|
1968
|
-
# @
|
2915
|
+
# @macro pChannelID
|
2916
|
+
# @macro pMessageID
|
2917
|
+
# @macro pReason
|
1969
2918
|
# @macro rResponse
|
1970
2919
|
#
|
1971
2920
|
# @see https://discord.com/developers/docs/resources/poll#end-poll
|
1972
2921
|
# Discord documentation "End Poll"
|
1973
|
-
def end_poll(channel_id, message_id)
|
1974
|
-
json_request(
|
2922
|
+
def end_poll(channel_id, message_id, reason: nil)
|
2923
|
+
json_request(
|
2924
|
+
:post,
|
2925
|
+
discord("/channels/#{channel_id}/polls/#{message_id}/expire"),
|
2926
|
+
headers: auditlog(reason)
|
2927
|
+
)
|
1975
2928
|
end
|
1976
2929
|
|
1977
2930
|
### }}} Poll
|
@@ -1979,13 +2932,18 @@ module LibDiscord
|
|
1979
2932
|
### SKU {{{
|
1980
2933
|
|
1981
2934
|
##
|
1982
|
-
# @
|
2935
|
+
# @macro pApplicationID
|
2936
|
+
# @macro pReason
|
1983
2937
|
# @macro rResponse
|
1984
2938
|
#
|
1985
2939
|
# @see https://discord.com/developers/docs/resources/sku#list-skus
|
1986
2940
|
# Discord documentation "List SKUs"
|
1987
|
-
def list_skus(application_id)
|
1988
|
-
json_request(
|
2941
|
+
def list_skus(application_id, reason: nil)
|
2942
|
+
json_request(
|
2943
|
+
:get,
|
2944
|
+
discord("/applications/#{application_id}/skus"),
|
2945
|
+
headers: auditlog(reason)
|
2946
|
+
)
|
1989
2947
|
end
|
1990
2948
|
|
1991
2949
|
### }}} SKU
|
@@ -1993,78 +2951,116 @@ module LibDiscord
|
|
1993
2951
|
### Soundboard {{{
|
1994
2952
|
|
1995
2953
|
##
|
1996
|
-
# @
|
2954
|
+
# @macro pChannelID
|
1997
2955
|
# @macro pBody
|
2956
|
+
# @macro pReason
|
1998
2957
|
# @macro rResponse
|
1999
2958
|
#
|
2000
2959
|
# @see https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound
|
2001
2960
|
# Discord documentation "Send Soundboard Sound"
|
2002
|
-
def send_soundboard_sound(channel_id, body)
|
2003
|
-
json_request(
|
2961
|
+
def send_soundboard_sound(channel_id, body, reason: nil)
|
2962
|
+
json_request(
|
2963
|
+
:post,
|
2964
|
+
discord("/channels/#{channel_id}/send-soundboard-sound"),
|
2965
|
+
body:,
|
2966
|
+
headers: auditlog(reason)
|
2967
|
+
)
|
2004
2968
|
end
|
2005
2969
|
|
2006
2970
|
##
|
2971
|
+
# @macro pReason
|
2007
2972
|
# @macro rResponse
|
2008
2973
|
#
|
2009
2974
|
# @see https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds
|
2010
2975
|
# Discord documentation "List Default Soundboard Sounds"
|
2011
|
-
def list_default_soundboard_sounds
|
2012
|
-
json_request(
|
2976
|
+
def list_default_soundboard_sounds(reason: nil)
|
2977
|
+
json_request(
|
2978
|
+
:get,
|
2979
|
+
discord("/soundboard-default-sounds"),
|
2980
|
+
headers: auditlog(reason)
|
2981
|
+
)
|
2013
2982
|
end
|
2014
2983
|
|
2015
2984
|
##
|
2016
|
-
# @
|
2985
|
+
# @macro pGuildID
|
2986
|
+
# @macro pReason
|
2017
2987
|
# @macro rResponse
|
2018
2988
|
#
|
2019
2989
|
# @see https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds
|
2020
2990
|
# Discord documentation "List Guild Soundboard Sounds"
|
2021
|
-
def list_guild_soundboard_sounds(guild_id)
|
2022
|
-
json_request(
|
2991
|
+
def list_guild_soundboard_sounds(guild_id, reason: nil)
|
2992
|
+
json_request(
|
2993
|
+
:get,
|
2994
|
+
discord("/guilds/#{guild_id}/soundboard-sounds"),
|
2995
|
+
headers: auditlog(reason)
|
2996
|
+
)
|
2023
2997
|
end
|
2024
2998
|
|
2025
2999
|
##
|
2026
|
-
# @
|
2027
|
-
# @
|
3000
|
+
# @macro pGuildID
|
3001
|
+
# @macro pSoundID
|
3002
|
+
# @macro pReason
|
2028
3003
|
# @macro rResponse
|
2029
3004
|
#
|
2030
3005
|
# @see https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound
|
2031
3006
|
# Discord documentation "Get Guild Soundboard Sound"
|
2032
|
-
def get_guild_soundboard_sound(guild_id, sound_id)
|
2033
|
-
json_request(
|
3007
|
+
def get_guild_soundboard_sound(guild_id, sound_id, reason: nil)
|
3008
|
+
json_request(
|
3009
|
+
:get,
|
3010
|
+
discord("/guilds/#{guild_id}/soundboard-sounds/#{sound_id}"),
|
3011
|
+
headers: auditlog(reason)
|
3012
|
+
)
|
2034
3013
|
end
|
2035
3014
|
|
2036
3015
|
##
|
2037
|
-
# @
|
3016
|
+
# @macro pGuildID
|
2038
3017
|
# @macro pBody
|
3018
|
+
# @macro pReason
|
2039
3019
|
# @macro rResponse
|
2040
3020
|
#
|
2041
3021
|
# @see https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound
|
2042
3022
|
# Discord documentation "Create Guild Soundboard Sound"
|
2043
|
-
def create_guild_soundboard_sound(guild_id, body)
|
2044
|
-
json_request(
|
3023
|
+
def create_guild_soundboard_sound(guild_id, body, reason: nil)
|
3024
|
+
json_request(
|
3025
|
+
:post,
|
3026
|
+
discord("/guilds/#{guild_id}/soundboard-sounds"),
|
3027
|
+
body:,
|
3028
|
+
headers: auditlog(reason)
|
3029
|
+
)
|
2045
3030
|
end
|
2046
3031
|
|
2047
3032
|
##
|
2048
|
-
# @
|
2049
|
-
# @
|
3033
|
+
# @macro pGuildID
|
3034
|
+
# @macro pSoundID
|
2050
3035
|
# @macro pBody
|
3036
|
+
# @macro pReason
|
2051
3037
|
# @macro rResponse
|
2052
3038
|
#
|
2053
3039
|
# @see https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound
|
2054
3040
|
# Discord documentation "Modify Guild Soundboard Sound"
|
2055
|
-
def modify_guild_soundboard_sound(guild_id, sound_id, body)
|
2056
|
-
json_request(
|
3041
|
+
def modify_guild_soundboard_sound(guild_id, sound_id, body, reason: nil)
|
3042
|
+
json_request(
|
3043
|
+
:patch,
|
3044
|
+
discord("/guilds/#{guild_id}/soundboard-sounds/#{sound_id}"),
|
3045
|
+
body:,
|
3046
|
+
headers: auditlog(reason)
|
3047
|
+
)
|
2057
3048
|
end
|
2058
3049
|
|
2059
3050
|
##
|
2060
|
-
# @
|
2061
|
-
# @
|
3051
|
+
# @macro pGuildID
|
3052
|
+
# @macro pSoundID
|
3053
|
+
# @macro pReason
|
2062
3054
|
# @macro rResponse
|
2063
3055
|
#
|
2064
3056
|
# @see https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound
|
2065
3057
|
# Discord documentation "Delete Guild Soundboard Sound"
|
2066
|
-
def delete_guild_soundboard_sound(guild_id, sound_id)
|
2067
|
-
json_request(
|
3058
|
+
def delete_guild_soundboard_sound(guild_id, sound_id, reason: nil)
|
3059
|
+
json_request(
|
3060
|
+
:delete,
|
3061
|
+
discord("/guilds/#{guild_id}/soundboard-sounds/#{sound_id}"),
|
3062
|
+
headers: auditlog(reason)
|
3063
|
+
)
|
2068
3064
|
end
|
2069
3065
|
|
2070
3066
|
### }}} Soundboard
|
@@ -2073,43 +3069,65 @@ module LibDiscord
|
|
2073
3069
|
|
2074
3070
|
##
|
2075
3071
|
# @macro pBody
|
3072
|
+
# @macro pReason
|
2076
3073
|
# @macro rResponse
|
2077
3074
|
#
|
2078
3075
|
# @see https://discord.com/developers/docs/resources/stage-instance#create-stage-instance
|
2079
3076
|
# Discord documentation "Create Stage Instance"
|
2080
|
-
def create_stage_instance(body)
|
2081
|
-
json_request(
|
3077
|
+
def create_stage_instance(body, reason: nil)
|
3078
|
+
json_request(
|
3079
|
+
:post,
|
3080
|
+
discord("/stage-instances"),
|
3081
|
+
body:,
|
3082
|
+
headers: auditlog(reason)
|
3083
|
+
)
|
2082
3084
|
end
|
2083
3085
|
|
2084
3086
|
##
|
2085
|
-
# @
|
3087
|
+
# @macro pChannelID
|
3088
|
+
# @macro pReason
|
2086
3089
|
# @macro rResponse
|
2087
3090
|
#
|
2088
3091
|
# @see https://discord.com/developers/docs/resources/stage-instance#get-stage-instance
|
2089
3092
|
# Discord documentation "Get Stage Instance"
|
2090
|
-
def get_stage_instance(channel_id)
|
2091
|
-
json_request(
|
3093
|
+
def get_stage_instance(channel_id, reason: nil)
|
3094
|
+
json_request(
|
3095
|
+
:get,
|
3096
|
+
discord("/stage-instances/#{channel_id}"),
|
3097
|
+
headers: auditlog(reason)
|
3098
|
+
)
|
2092
3099
|
end
|
2093
3100
|
|
2094
3101
|
##
|
2095
|
-
# @
|
3102
|
+
# @macro pChannelID
|
2096
3103
|
# @macro pBody
|
3104
|
+
# @macro pReason
|
2097
3105
|
# @macro rResponse
|
2098
3106
|
#
|
2099
3107
|
# @see https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance
|
2100
3108
|
# Discord documentation "Modify Stage Instance"
|
2101
|
-
def modify_stage_instance(channel_id, body)
|
2102
|
-
json_request(
|
3109
|
+
def modify_stage_instance(channel_id, body, reason: nil)
|
3110
|
+
json_request(
|
3111
|
+
:patch,
|
3112
|
+
discord("/stage-instances/#{channel_id}"),
|
3113
|
+
body:,
|
3114
|
+
headers: auditlog(reason)
|
3115
|
+
)
|
2103
3116
|
end
|
2104
3117
|
|
2105
3118
|
##
|
2106
|
-
# @
|
3119
|
+
# @macro pChannelID
|
3120
|
+
# @macro pReason
|
2107
3121
|
# @macro rResponse
|
2108
3122
|
#
|
2109
3123
|
# @see https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance
|
2110
3124
|
# Discord documentation "Delete Stage Instance"
|
2111
|
-
def delete_stage_instance(channel_id)
|
2112
|
-
json_request(
|
3125
|
+
def delete_stage_instance(channel_id, reason: nil)
|
3126
|
+
json_request(
|
3127
|
+
:delete,
|
3128
|
+
discord("/stage-instances/#{channel_id}"),
|
3129
|
+
headers: auditlog(reason)
|
3130
|
+
)
|
2113
3131
|
end
|
2114
3132
|
|
2115
3133
|
### }}} Stage Instance
|
@@ -2117,87 +3135,129 @@ module LibDiscord
|
|
2117
3135
|
### Sticker {{{
|
2118
3136
|
|
2119
3137
|
##
|
2120
|
-
# @
|
3138
|
+
# @macro pStickerID
|
3139
|
+
# @macro pReason
|
2121
3140
|
# @macro rResponse
|
2122
3141
|
#
|
2123
3142
|
# @see https://discord.com/developers/docs/resources/sticker#get-sticker
|
2124
3143
|
# Discord documentation "Get Sticker"
|
2125
|
-
def get_sticker(sticker_id)
|
2126
|
-
json_request(
|
3144
|
+
def get_sticker(sticker_id, reason: nil)
|
3145
|
+
json_request(
|
3146
|
+
:get,
|
3147
|
+
discord("/stickers/#{sticker_id}"),
|
3148
|
+
headers: auditlog(reason)
|
3149
|
+
)
|
2127
3150
|
end
|
2128
3151
|
|
2129
3152
|
##
|
3153
|
+
# @macro pReason
|
2130
3154
|
# @macro rResponse
|
2131
3155
|
#
|
2132
3156
|
# @see https://discord.com/developers/docs/resources/sticker#list-sticker-packs
|
2133
3157
|
# Discord documentation "List Sticker Packs"
|
2134
|
-
def list_sticker_packs
|
2135
|
-
json_request(
|
3158
|
+
def list_sticker_packs(reason: nil)
|
3159
|
+
json_request(
|
3160
|
+
:get,
|
3161
|
+
discord("/sticker-packs"),
|
3162
|
+
headers: auditlog(reason)
|
3163
|
+
)
|
2136
3164
|
end
|
2137
3165
|
|
2138
3166
|
##
|
2139
|
-
# @
|
3167
|
+
# @macro pStickerPackID
|
3168
|
+
# @macro pReason
|
2140
3169
|
# @macro rResponse
|
2141
3170
|
#
|
2142
3171
|
# @see https://discord.com/developers/docs/resources/sticker#get-sticker-pack
|
2143
3172
|
# Discord documentation "Get Sticker Pack"
|
2144
|
-
def get_sticker_pack(pack_id)
|
2145
|
-
json_request(
|
3173
|
+
def get_sticker_pack(pack_id, reason: nil)
|
3174
|
+
json_request(
|
3175
|
+
:get,
|
3176
|
+
discord("/sticker-packs/#{pack_id}"),
|
3177
|
+
headers: auditlog(reason)
|
3178
|
+
)
|
2146
3179
|
end
|
2147
3180
|
|
2148
3181
|
##
|
2149
|
-
# @
|
3182
|
+
# @macro pGuildID
|
3183
|
+
# @macro pReason
|
2150
3184
|
# @macro rResponse
|
2151
3185
|
#
|
2152
3186
|
# @see https://discord.com/developers/docs/resources/sticker#list-guild-stickers
|
2153
3187
|
# Discord documentation "List Guild Stickers"
|
2154
|
-
def list_guild_stickers(guild_id)
|
2155
|
-
json_request(
|
3188
|
+
def list_guild_stickers(guild_id, reason: nil)
|
3189
|
+
json_request(
|
3190
|
+
:get,
|
3191
|
+
discord("/guilds/#{guild_id}/stickers"),
|
3192
|
+
headers: auditlog(reason)
|
3193
|
+
)
|
2156
3194
|
end
|
2157
3195
|
|
2158
3196
|
##
|
2159
|
-
# @
|
2160
|
-
# @
|
3197
|
+
# @macro pGuildID
|
3198
|
+
# @macro pStickerID
|
3199
|
+
# @macro pReason
|
2161
3200
|
# @macro rResponse
|
2162
3201
|
#
|
2163
3202
|
# @see https://discord.com/developers/docs/resources/sticker#get-guild-sticker
|
2164
3203
|
# Discord documentation "Get Guild Sticker"
|
2165
|
-
def get_guild_sticker(guild_id, sticker_id)
|
2166
|
-
json_request(
|
3204
|
+
def get_guild_sticker(guild_id, sticker_id, reason: nil)
|
3205
|
+
json_request(
|
3206
|
+
:get,
|
3207
|
+
discord("/guilds/#{guild_id}/stickers/#{sticker_id}"),
|
3208
|
+
headers: auditlog(reason)
|
3209
|
+
)
|
2167
3210
|
end
|
2168
3211
|
|
2169
3212
|
##
|
2170
|
-
# @
|
3213
|
+
# @macro pGuildID
|
2171
3214
|
# @macro pBody
|
3215
|
+
# @macro pReason
|
2172
3216
|
# @macro rResponse
|
2173
3217
|
#
|
2174
3218
|
# @see https://discord.com/developers/docs/resources/sticker#create-guild-sticker
|
2175
3219
|
# Discord documentation "Create Guild Sticker"
|
2176
|
-
def create_guild_sticker(guild_id, body)
|
2177
|
-
json_request(
|
3220
|
+
def create_guild_sticker(guild_id, body, reason: nil)
|
3221
|
+
json_request(
|
3222
|
+
:post,
|
3223
|
+
discord("/guilds/#{guild_id}/stickers"),
|
3224
|
+
body:,
|
3225
|
+
headers: auditlog(reason)
|
3226
|
+
)
|
2178
3227
|
end
|
2179
3228
|
|
2180
3229
|
##
|
2181
|
-
# @
|
2182
|
-
# @
|
3230
|
+
# @macro pGuildID
|
3231
|
+
# @macro pStickerID
|
2183
3232
|
# @macro pBody
|
3233
|
+
# @macro pReason
|
2184
3234
|
# @macro rResponse
|
2185
3235
|
#
|
2186
3236
|
# @see https://discord.com/developers/docs/resources/sticker#modify-guild-sticker
|
2187
3237
|
# Discord documentation "Modify Guild Sticker"
|
2188
|
-
def modify_guild_sticker(guild_id, sticker_id, body)
|
2189
|
-
json_request(
|
3238
|
+
def modify_guild_sticker(guild_id, sticker_id, body, reason: nil)
|
3239
|
+
json_request(
|
3240
|
+
:patch,
|
3241
|
+
discord("/guilds/#{guild_id}/stickers/#{sticker_id}"),
|
3242
|
+
body:,
|
3243
|
+
headers: auditlog(reason)
|
3244
|
+
)
|
2190
3245
|
end
|
2191
3246
|
|
2192
3247
|
##
|
2193
|
-
# @
|
2194
|
-
# @
|
3248
|
+
# @macro pGuildID
|
3249
|
+
# @macro pStickerID
|
3250
|
+
# @macro pReason
|
2195
3251
|
# @macro rResponse
|
2196
3252
|
#
|
2197
3253
|
# @see https://discord.com/developers/docs/resources/sticker#delete-guild-sticker
|
2198
3254
|
# Discord documentation "Delete Guild Sticker"
|
2199
|
-
def delete_guild_sticker(guild_id, sticker_id)
|
2200
|
-
json_request(
|
3255
|
+
def delete_guild_sticker(guild_id, sticker_id, reason: nil)
|
3256
|
+
json_request(
|
3257
|
+
:delete,
|
3258
|
+
discord("/guilds/#{guild_id}/stickers/#{sticker_id}"),
|
3259
|
+
headers: auditlog(reason)
|
3260
|
+
)
|
2201
3261
|
end
|
2202
3262
|
|
2203
3263
|
### }}} Sticker
|
@@ -2205,25 +3265,36 @@ module LibDiscord
|
|
2205
3265
|
### Subscription {{{
|
2206
3266
|
|
2207
3267
|
##
|
2208
|
-
# @
|
3268
|
+
# @macro pSkuID
|
2209
3269
|
# @macro pQuery
|
3270
|
+
# @macro pReason
|
2210
3271
|
# @macro rResponse
|
2211
3272
|
#
|
2212
3273
|
# @see https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions
|
2213
3274
|
# Discord documentation "List SKU Subscriptions"
|
2214
|
-
def list_sku_subscriptions(sku_id, query = {})
|
2215
|
-
json_request(
|
3275
|
+
def list_sku_subscriptions(sku_id, query = {}, reason: nil)
|
3276
|
+
json_request(
|
3277
|
+
:get,
|
3278
|
+
discord("/skus/#{sku_id}/subscriptions"),
|
3279
|
+
query:,
|
3280
|
+
headers: auditlog(reason)
|
3281
|
+
)
|
2216
3282
|
end
|
2217
3283
|
|
2218
3284
|
##
|
2219
|
-
# @
|
2220
|
-
# @
|
3285
|
+
# @macro pSkuID
|
3286
|
+
# @macro pSubscriptionID
|
3287
|
+
# @macro pReason
|
2221
3288
|
# @macro rResponse
|
2222
3289
|
#
|
2223
3290
|
# @see https://discord.com/developers/docs/resources/subscription#get-sku-subscription
|
2224
3291
|
# Discord documentation "Get SKU Subscription"
|
2225
|
-
def get_sku_subscription(sku_id, subscription_id)
|
2226
|
-
json_request(
|
3292
|
+
def get_sku_subscription(sku_id, subscription_id, reason: nil)
|
3293
|
+
json_request(
|
3294
|
+
:get,
|
3295
|
+
discord("/skus/#{sku_id}/subscriptions/#{subscription_id}"),
|
3296
|
+
headers: auditlog(reason)
|
3297
|
+
)
|
2227
3298
|
end
|
2228
3299
|
|
2229
3300
|
### }}} Subscription
|
@@ -2231,112 +3302,171 @@ module LibDiscord
|
|
2231
3302
|
### User {{{
|
2232
3303
|
|
2233
3304
|
##
|
3305
|
+
# @macro pReason
|
2234
3306
|
# @macro rResponse
|
2235
3307
|
#
|
2236
3308
|
# @see https://discord.com/developers/docs/resources/user#get-current-user
|
2237
3309
|
# Discord documentation "Get Current User"
|
2238
|
-
def get_current_user
|
2239
|
-
json_request(
|
3310
|
+
def get_current_user(reason: nil)
|
3311
|
+
json_request(
|
3312
|
+
:get, discord("/users/@me"),
|
3313
|
+
headers: auditlog(reason)
|
3314
|
+
)
|
2240
3315
|
end
|
2241
3316
|
|
2242
3317
|
##
|
2243
|
-
# @
|
3318
|
+
# @macro pUserID
|
3319
|
+
# @macro pReason
|
2244
3320
|
# @macro rResponse
|
2245
3321
|
#
|
2246
3322
|
# @see https://discord.com/developers/docs/resources/user#get-user
|
2247
3323
|
# Discord documentation "Get User"
|
2248
|
-
def get_user(user_id)
|
2249
|
-
json_request(
|
3324
|
+
def get_user(user_id, reason: nil)
|
3325
|
+
json_request(
|
3326
|
+
:get,
|
3327
|
+
discord("/users/#{user_id}"),
|
3328
|
+
headers: auditlog(reason)
|
3329
|
+
)
|
2250
3330
|
end
|
2251
3331
|
|
2252
3332
|
##
|
2253
3333
|
# @macro pBody
|
3334
|
+
# @macro pReason
|
2254
3335
|
# @macro rResponse
|
2255
3336
|
#
|
2256
3337
|
# @see https://discord.com/developers/docs/resources/user#modify-current-user
|
2257
3338
|
# Discord documentation "Modify Current User"
|
2258
|
-
def modify_current_user(body)
|
2259
|
-
json_request(
|
3339
|
+
def modify_current_user(body, reason: nil)
|
3340
|
+
json_request(
|
3341
|
+
:patch,
|
3342
|
+
discord("/users/@me"),
|
3343
|
+
body:,
|
3344
|
+
headers: auditlog(reason)
|
3345
|
+
)
|
2260
3346
|
end
|
2261
3347
|
|
2262
3348
|
##
|
2263
3349
|
# @macro pQuery
|
3350
|
+
# @macro pReason
|
2264
3351
|
# @macro rResponse
|
2265
3352
|
#
|
2266
3353
|
# @see https://discord.com/developers/docs/resources/user#get-current-user-guilds
|
2267
3354
|
# Discord documentation "Get Current User Guilds"
|
2268
|
-
def get_current_user_guilds(query = {})
|
2269
|
-
json_request(
|
3355
|
+
def get_current_user_guilds(query = {}, reason: nil)
|
3356
|
+
json_request(
|
3357
|
+
:get,
|
3358
|
+
discord("/users/@me/guilds"),
|
3359
|
+
query:,
|
3360
|
+
headers: auditlog(reason)
|
3361
|
+
)
|
2270
3362
|
end
|
2271
3363
|
|
2272
3364
|
##
|
2273
|
-
# @
|
3365
|
+
# @macro pGuildID
|
3366
|
+
# @macro pReason
|
2274
3367
|
# @macro rResponse
|
2275
3368
|
#
|
2276
3369
|
# @see https://discord.com/developers/docs/resources/user#get-current-user-guild-member
|
2277
3370
|
# Discord documentation "Get Current User Guild Member"
|
2278
|
-
def get_current_user_guild_member(guild_id)
|
2279
|
-
json_request(
|
3371
|
+
def get_current_user_guild_member(guild_id, reason: nil)
|
3372
|
+
json_request(
|
3373
|
+
:get,
|
3374
|
+
discord("/users/@me/guilds/#{guild_id}/member"),
|
3375
|
+
headers: auditlog(reason)
|
3376
|
+
)
|
2280
3377
|
end
|
2281
3378
|
|
2282
3379
|
##
|
2283
|
-
# @
|
3380
|
+
# @macro pGuildID
|
3381
|
+
# @macro pReason
|
2284
3382
|
# @macro rResponse
|
2285
3383
|
#
|
2286
3384
|
# @see https://discord.com/developers/docs/resources/user#leave-guild
|
2287
3385
|
# Discord documentation "Leave Guild"
|
2288
|
-
def leave_guild(guild_id)
|
2289
|
-
json_request(
|
3386
|
+
def leave_guild(guild_id, reason: nil)
|
3387
|
+
json_request(
|
3388
|
+
:delete,
|
3389
|
+
discord("/users/@me/guilds/#{guild_id}"),
|
3390
|
+
headers: auditlog(reason)
|
3391
|
+
)
|
2290
3392
|
end
|
2291
3393
|
|
2292
3394
|
##
|
2293
3395
|
# @macro pBody
|
3396
|
+
# @macro pReason
|
2294
3397
|
# @macro rResponse
|
2295
3398
|
#
|
2296
3399
|
# @see https://discord.com/developers/docs/resources/user#create-dm
|
2297
3400
|
# Discord documentation "Create DM"
|
2298
|
-
def create_dm(body)
|
2299
|
-
json_request(
|
3401
|
+
def create_dm(body, reason: nil)
|
3402
|
+
json_request(
|
3403
|
+
:post,
|
3404
|
+
discord("/users/@me/channels"),
|
3405
|
+
body:,
|
3406
|
+
headers: auditlog(reason)
|
3407
|
+
)
|
2300
3408
|
end
|
2301
3409
|
|
2302
3410
|
##
|
2303
3411
|
# @macro pBody
|
3412
|
+
# @macro pReason
|
2304
3413
|
# @macro rResponse
|
2305
3414
|
#
|
2306
3415
|
# @see https://discord.com/developers/docs/resources/user#create-group-dm
|
2307
3416
|
# Discord documentation "Create Group DM"
|
2308
|
-
def create_group_dm(body)
|
2309
|
-
json_request(
|
3417
|
+
def create_group_dm(body, reason: nil)
|
3418
|
+
json_request(
|
3419
|
+
:post,
|
3420
|
+
discord("/users/@me/channels"),
|
3421
|
+
body:,
|
3422
|
+
headers: auditlog(reason)
|
3423
|
+
)
|
2310
3424
|
end
|
2311
3425
|
|
2312
3426
|
##
|
3427
|
+
# @macro pReason
|
2313
3428
|
# @macro rResponse
|
2314
3429
|
#
|
2315
3430
|
# @see https://discord.com/developers/docs/resources/user#get-current-user-connections
|
2316
3431
|
# Discord documentation "Get Current User Connections"
|
2317
|
-
def get_current_user_connections
|
2318
|
-
json_request(
|
3432
|
+
def get_current_user_connections(reason: nil)
|
3433
|
+
json_request(
|
3434
|
+
:get,
|
3435
|
+
discord("/users/@me/connections"),
|
3436
|
+
headers: auditlog(reason)
|
3437
|
+
)
|
2319
3438
|
end
|
2320
3439
|
|
2321
3440
|
##
|
2322
|
-
# @
|
3441
|
+
# @macro pApplicationID
|
3442
|
+
# @macro pReason
|
2323
3443
|
# @macro rResponse
|
2324
3444
|
#
|
2325
3445
|
# @see https://discord.com/developers/docs/resources/user#get-current-user-application-role-connection
|
2326
3446
|
# Discord documentation "Get Current User Application Role Connection"
|
2327
|
-
def get_current_user_application_role_connection(application_id)
|
2328
|
-
json_request(
|
3447
|
+
def get_current_user_application_role_connection(application_id, reason: nil)
|
3448
|
+
json_request(
|
3449
|
+
:get,
|
3450
|
+
discord("/users/@me/applications/#{application_id}/role-connections"),
|
3451
|
+
headers: auditlog(reason)
|
3452
|
+
)
|
2329
3453
|
end
|
2330
3454
|
|
2331
3455
|
##
|
2332
|
-
# @
|
3456
|
+
# @macro pApplicationID
|
2333
3457
|
# @macro pBody
|
3458
|
+
# @macro pReason
|
2334
3459
|
# @macro rResponse
|
2335
3460
|
#
|
2336
3461
|
# @see https://discord.com/developers/docs/resources/user#update-current-user-application-role-connection
|
2337
3462
|
# Discord documentation "Update Current User Application Role Connection"
|
2338
|
-
def update_current_user_application_role_connection(application_id, body)
|
2339
|
-
json_request(
|
3463
|
+
def update_current_user_application_role_connection(application_id, body, reason: nil)
|
3464
|
+
json_request(
|
3465
|
+
:put,
|
3466
|
+
discord("/users/@me/applications/#{application_id}/role-connection"),
|
3467
|
+
body:,
|
3468
|
+
headers: auditlog(reason)
|
3469
|
+
)
|
2340
3470
|
end
|
2341
3471
|
|
2342
3472
|
### }}} User
|
@@ -2344,56 +3474,83 @@ module LibDiscord
|
|
2344
3474
|
### Voice {{{
|
2345
3475
|
|
2346
3476
|
##
|
3477
|
+
# @macro pReason
|
2347
3478
|
# @macro rResponse
|
2348
3479
|
#
|
2349
3480
|
# @see https://discord.com/developers/docs/resources/voice#list-voice-regions
|
2350
3481
|
# Discord documentation "List Voice Regions"
|
2351
|
-
def list_voice_regions
|
2352
|
-
json_request(
|
3482
|
+
def list_voice_regions(reason: nil)
|
3483
|
+
json_request(
|
3484
|
+
:get,
|
3485
|
+
discord("/voice/regions"),
|
3486
|
+
headers: auditlog(reason)
|
3487
|
+
)
|
2353
3488
|
end
|
2354
3489
|
|
2355
3490
|
##
|
2356
|
-
# @
|
3491
|
+
# @macro pGuildID
|
3492
|
+
# @macro pReason
|
2357
3493
|
# @macro rResponse
|
2358
3494
|
#
|
2359
3495
|
# @see https://discord.com/developers/docs/resources/voice#get-current-user-voice-state
|
2360
3496
|
# Discord documentation "Get Current User Voice State"
|
2361
|
-
def get_current_user_voice_state(guild_id)
|
2362
|
-
json_request(
|
3497
|
+
def get_current_user_voice_state(guild_id, reason: nil)
|
3498
|
+
json_request(
|
3499
|
+
:get,
|
3500
|
+
discord("/guilds/#{guild_id}/voice-states/@me"),
|
3501
|
+
headers: auditlog(reason)
|
3502
|
+
)
|
2363
3503
|
end
|
2364
3504
|
|
2365
3505
|
##
|
2366
|
-
# @
|
2367
|
-
# @
|
3506
|
+
# @macro pGuildID
|
3507
|
+
# @macro pUserID
|
3508
|
+
# @macro pReason
|
2368
3509
|
# @macro rResponse
|
2369
3510
|
#
|
2370
3511
|
# @see https://discord.com/developers/docs/resources/voice#get-user-voice-state
|
2371
3512
|
# Discord documentation "Get User Voice State"
|
2372
|
-
def get_user_voice_state(guild_id, user_id)
|
2373
|
-
json_request(
|
3513
|
+
def get_user_voice_state(guild_id, user_id, reason: nil)
|
3514
|
+
json_request(
|
3515
|
+
:get,
|
3516
|
+
discord("/guilds/#{guild_id}/voice-states/#{user_id}"),
|
3517
|
+
headers: auditlog(reason)
|
3518
|
+
)
|
2374
3519
|
end
|
2375
3520
|
|
2376
3521
|
##
|
2377
|
-
# @
|
3522
|
+
# @macro pGuildID
|
2378
3523
|
# @macro pBody
|
3524
|
+
# @macro pReason
|
2379
3525
|
# @macro rResponse
|
2380
3526
|
#
|
2381
3527
|
# @see https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state
|
2382
3528
|
# Discord documentation "Modify Current User Voice State"
|
2383
|
-
def modify_current_user_voice_state(guild_id, body)
|
2384
|
-
json_request(
|
3529
|
+
def modify_current_user_voice_state(guild_id, body, reason: nil)
|
3530
|
+
json_request(
|
3531
|
+
:patch,
|
3532
|
+
discord("/guilds/#{guild_id}/voice-states/@me"),
|
3533
|
+
body:,
|
3534
|
+
headers: auditlog(reason)
|
3535
|
+
)
|
2385
3536
|
end
|
2386
3537
|
|
2387
3538
|
##
|
2388
|
-
# @
|
2389
|
-
# @
|
3539
|
+
# @macro pGuildID
|
3540
|
+
# @macro pUserID
|
2390
3541
|
# @macro pBody
|
3542
|
+
# @macro pReason
|
2391
3543
|
# @macro rResponse
|
2392
3544
|
#
|
2393
3545
|
# @see https://discord.com/developers/docs/resources/voice#modify-user-voice-state
|
2394
3546
|
# Discord documentation "Modify User Voice State"
|
2395
|
-
def modify_user_voice_state(guild_id, user_id, body)
|
2396
|
-
json_request(
|
3547
|
+
def modify_user_voice_state(guild_id, user_id, body, reason: nil)
|
3548
|
+
json_request(
|
3549
|
+
:patch,
|
3550
|
+
discord("/guilds/#{guild_id}/voice-states/#{user_id}"),
|
3551
|
+
body:,
|
3552
|
+
headers: auditlog(reason)
|
3553
|
+
)
|
2397
3554
|
end
|
2398
3555
|
|
2399
3556
|
### }}} Voice
|
@@ -2401,175 +3558,260 @@ module LibDiscord
|
|
2401
3558
|
### Webhook {{{
|
2402
3559
|
|
2403
3560
|
##
|
2404
|
-
# @
|
3561
|
+
# @macro pChannelID
|
2405
3562
|
# @macro pBody
|
3563
|
+
# @macro pReason
|
2406
3564
|
# @macro rResponse
|
2407
3565
|
#
|
2408
3566
|
# @see https://discord.com/developers/docs/resources/webhook#create-webhook
|
2409
3567
|
# Discord documentation "Create Webhook"
|
2410
|
-
def create_webhook(channel_id, body)
|
2411
|
-
json_request(
|
3568
|
+
def create_webhook(channel_id, body, reason: nil)
|
3569
|
+
json_request(
|
3570
|
+
:post,
|
3571
|
+
discord("/channels/#{channel_id}/webhooks"),
|
3572
|
+
body:,
|
3573
|
+
headers: auditlog(reason)
|
3574
|
+
)
|
2412
3575
|
end
|
2413
3576
|
|
2414
3577
|
##
|
2415
|
-
# @
|
3578
|
+
# @macro pChannelID
|
3579
|
+
# @macro pReason
|
2416
3580
|
# @macro rResponse
|
2417
3581
|
#
|
2418
3582
|
# @see https://discord.com/developers/docs/resources/webhook#get-channel-webhooks
|
2419
3583
|
# Discord documentation "Get Channel Webhooks"
|
2420
|
-
def get_channel_webhooks(channel_id)
|
2421
|
-
json_request(
|
3584
|
+
def get_channel_webhooks(channel_id, reason: nil)
|
3585
|
+
json_request(
|
3586
|
+
:get,
|
3587
|
+
discord("/channels/#{channel_id}/webhooks"),
|
3588
|
+
headers: auditlog(reason)
|
3589
|
+
)
|
2422
3590
|
end
|
2423
3591
|
|
2424
3592
|
##
|
2425
|
-
# @
|
3593
|
+
# @macro pGuildID
|
3594
|
+
# @macro pReason
|
2426
3595
|
# @macro rResponse
|
2427
3596
|
#
|
2428
3597
|
# @see https://discord.com/developers/docs/resources/webhook#get-guild-webhooks
|
2429
3598
|
# Discord documentation "Get Guild Webhooks"
|
2430
|
-
def get_guild_webhooks(guild_id)
|
2431
|
-
json_request(
|
3599
|
+
def get_guild_webhooks(guild_id, reason: nil)
|
3600
|
+
json_request(
|
3601
|
+
:get,
|
3602
|
+
discord("/guilds/#{guild_id}/webhooks"),
|
3603
|
+
headers: auditlog(reason)
|
3604
|
+
)
|
2432
3605
|
end
|
2433
3606
|
|
2434
3607
|
##
|
2435
|
-
# @
|
3608
|
+
# @macro pWebhookID
|
3609
|
+
# @macro pReason
|
2436
3610
|
# @macro rResponse
|
2437
3611
|
#
|
2438
3612
|
# @see https://discord.com/developers/docs/resources/webhook#get-webhook
|
2439
3613
|
# Discord documentation "Get Webhook"
|
2440
|
-
def get_webhook(webhook_id)
|
2441
|
-
json_request(
|
3614
|
+
def get_webhook(webhook_id, reason: nil)
|
3615
|
+
json_request(
|
3616
|
+
:get,
|
3617
|
+
discord("/webhooks/#{webhook_id}"),
|
3618
|
+
headers: auditlog(reason)
|
3619
|
+
)
|
2442
3620
|
end
|
2443
3621
|
|
2444
3622
|
##
|
2445
|
-
# @
|
2446
|
-
# @
|
3623
|
+
# @macro pWebhookID
|
3624
|
+
# @macro pWebhookToken
|
3625
|
+
# @macro pReason
|
2447
3626
|
# @macro rResponse
|
2448
3627
|
#
|
2449
3628
|
# @see https://discord.com/developers/docs/resources/webhook#get-webhook-with-token
|
2450
3629
|
# Discord documentation "Get Webhook with Token"
|
2451
|
-
def get_webhook_with_token(webhook_id, webhook_token)
|
2452
|
-
json_request(
|
3630
|
+
def get_webhook_with_token(webhook_id, webhook_token, reason: nil)
|
3631
|
+
json_request(
|
3632
|
+
:get,
|
3633
|
+
discord("/webhooks/#{webhook_id}/#{webhook_token}"),
|
3634
|
+
headers: auditlog(reason)
|
3635
|
+
)
|
2453
3636
|
end
|
2454
3637
|
|
2455
3638
|
##
|
2456
|
-
# @
|
3639
|
+
# @macro pWebhookID
|
2457
3640
|
# @macro pBody
|
3641
|
+
# @macro pReason
|
2458
3642
|
# @macro rResponse
|
2459
3643
|
#
|
2460
3644
|
# @see https://discord.com/developers/docs/resources/webhook#modify-webhook
|
2461
3645
|
# Discord documentation "Modify Webhook"
|
2462
|
-
def modify_webhook(webhook_id, body)
|
2463
|
-
json_request(
|
3646
|
+
def modify_webhook(webhook_id, body, reason: nil)
|
3647
|
+
json_request(
|
3648
|
+
:patch,
|
3649
|
+
discord("/webhooks/#{webhook_id}"),
|
3650
|
+
body:,
|
3651
|
+
headers: auditlog(reason)
|
3652
|
+
)
|
2464
3653
|
end
|
2465
3654
|
|
2466
3655
|
##
|
2467
|
-
# @
|
2468
|
-
# @
|
3656
|
+
# @macro pWebhookID
|
3657
|
+
# @macro pWebhookToken
|
2469
3658
|
# @macro pBody
|
3659
|
+
# @macro pReason
|
2470
3660
|
# @macro rResponse
|
2471
3661
|
#
|
2472
3662
|
# @see https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token
|
2473
3663
|
# Discord documentation "Modify Webhook with Token"
|
2474
|
-
def modify_webhook_with_token(webhook_id, webhook_token, body)
|
2475
|
-
json_request(
|
3664
|
+
def modify_webhook_with_token(webhook_id, webhook_token, body, reason: nil)
|
3665
|
+
json_request(
|
3666
|
+
:patch,
|
3667
|
+
discord("/webhooks/#{webhook_id}/#{webhook_token}"),
|
3668
|
+
body:,
|
3669
|
+
headers: auditlog(reason)
|
3670
|
+
)
|
2476
3671
|
end
|
2477
3672
|
|
2478
3673
|
##
|
2479
|
-
# @
|
3674
|
+
# @macro pWebhookID
|
3675
|
+
# @macro pReason
|
2480
3676
|
# @macro rResponse
|
2481
3677
|
#
|
2482
3678
|
# @see https://discord.com/developers/docs/resources/webhook#delete-webhook
|
2483
3679
|
# Discord documentation "Delete Webhook"
|
2484
|
-
def delete_webhook(webhook_id)
|
2485
|
-
json_request(
|
3680
|
+
def delete_webhook(webhook_id, reason: nil)
|
3681
|
+
json_request(
|
3682
|
+
:delete,
|
3683
|
+
discord("/webhooks/#{webhook_id}"),
|
3684
|
+
headers: auditlog(reason)
|
3685
|
+
)
|
2486
3686
|
end
|
2487
3687
|
|
2488
3688
|
##
|
2489
|
-
# @
|
2490
|
-
# @
|
3689
|
+
# @macro pWebhookID
|
3690
|
+
# @macro pWebhookToken
|
3691
|
+
# @macro pReason
|
2491
3692
|
# @macro rResponse
|
2492
3693
|
#
|
2493
3694
|
# @see https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token
|
2494
3695
|
# Discord documentation "Delete Webhook with Token"
|
2495
|
-
def delete_webhook_with_token(webhook_id, webhook_token)
|
2496
|
-
json_request(
|
3696
|
+
def delete_webhook_with_token(webhook_id, webhook_token, reason: nil)
|
3697
|
+
json_request(
|
3698
|
+
:delete,
|
3699
|
+
discord("/webhooks/#{webhook_id}/#{webhook_token}"),
|
3700
|
+
headers: auditlog(reason)
|
3701
|
+
)
|
2497
3702
|
end
|
2498
3703
|
|
2499
3704
|
##
|
2500
|
-
# @
|
2501
|
-
# @
|
3705
|
+
# @macro pWebhookID
|
3706
|
+
# @macro pWebhookToken
|
2502
3707
|
# @macro pBody
|
2503
3708
|
# @macro pQuery
|
3709
|
+
# @macro pReason
|
2504
3710
|
# @macro rResponse
|
2505
3711
|
#
|
2506
3712
|
# @see https://discord.com/developers/docs/resources/webhook#execute-webhook
|
2507
3713
|
# Discord documentation "Execute Webhook"
|
2508
|
-
def execute_webhook(webhook_id, webhook_token, body, query = {})
|
2509
|
-
json_request(
|
3714
|
+
def execute_webhook(webhook_id, webhook_token, body, query = {}, reason: nil)
|
3715
|
+
json_request(
|
3716
|
+
:post,
|
3717
|
+
discord("/webhooks/#{webhook_id}/#{webhook_token}"),
|
3718
|
+
body:,
|
3719
|
+
query:,
|
3720
|
+
headers: auditlog(reason)
|
3721
|
+
)
|
2510
3722
|
end
|
2511
3723
|
|
2512
3724
|
##
|
2513
|
-
# @
|
2514
|
-
# @
|
3725
|
+
# @macro pWebhookID
|
3726
|
+
# @macro pWebhookToken
|
2515
3727
|
# @macro pQuery
|
3728
|
+
# @macro pReason
|
2516
3729
|
# @macro rResponse
|
2517
3730
|
#
|
2518
3731
|
# @see https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook
|
2519
3732
|
# Discord documentation "Execute Slack-Compatible Webhook"
|
2520
|
-
def execute_slack_compatible_webhook(webhook_id, webhook_token, query = {})
|
2521
|
-
json_request(
|
3733
|
+
def execute_slack_compatible_webhook(webhook_id, webhook_token, query = {}, reason: nil)
|
3734
|
+
json_request(
|
3735
|
+
:post,
|
3736
|
+
discord("/webhooks/#{webhook_id}/#{webhook_token}/slack"),
|
3737
|
+
query:,
|
3738
|
+
headers: auditlog(reason)
|
3739
|
+
)
|
2522
3740
|
end
|
2523
3741
|
|
2524
3742
|
##
|
2525
|
-
# @
|
2526
|
-
# @
|
3743
|
+
# @macro pWebhookID
|
3744
|
+
# @macro pWebhookToken
|
2527
3745
|
# @macro pQuery
|
3746
|
+
# @macro pReason
|
2528
3747
|
# @macro rResponse
|
2529
3748
|
#
|
2530
3749
|
# @see https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook
|
2531
3750
|
# Discord documentation "Execute GitHub-Compatible Webhook
|
2532
|
-
def execute_github_compatible_webhook(webhook_id, webhook_token, query = {})
|
2533
|
-
json_request(
|
3751
|
+
def execute_github_compatible_webhook(webhook_id, webhook_token, query = {}, reason: nil)
|
3752
|
+
json_request(
|
3753
|
+
:post,
|
3754
|
+
discord("/webhooks/#{webhook_id}/#{webhook_token}/github"),
|
3755
|
+
query:,
|
3756
|
+
headers: auditlog(reason)
|
3757
|
+
)
|
2534
3758
|
end
|
2535
3759
|
|
2536
3760
|
##
|
2537
|
-
# @
|
2538
|
-
# @
|
2539
|
-
# @
|
3761
|
+
# @macro pWebhookID
|
3762
|
+
# @macro pWebhookToken
|
3763
|
+
# @macro pMessageID
|
2540
3764
|
# @macro pQuery
|
3765
|
+
# @macro pReason
|
2541
3766
|
# @macro rResponse
|
2542
3767
|
#
|
2543
3768
|
# @see https://discord.com/developers/docs/resources/webhook#get-webhook-message
|
2544
3769
|
# Discord documentation "Get Webhook Message"
|
2545
|
-
def get_webhook_message(webhook_id, webhook_token, message_id, query = {})
|
2546
|
-
json_request(
|
3770
|
+
def get_webhook_message(webhook_id, webhook_token, message_id, query = {}, reason: nil)
|
3771
|
+
json_request(
|
3772
|
+
:get,
|
3773
|
+
discord("/webhooks/#{webhook_id}/#{webhook_token}/messages/#{message_id}"),
|
3774
|
+
query:,
|
3775
|
+
headers: auditlog(reason)
|
3776
|
+
)
|
2547
3777
|
end
|
2548
3778
|
|
2549
3779
|
##
|
2550
|
-
# @
|
2551
|
-
# @
|
2552
|
-
# @
|
3780
|
+
# @macro pWebhookID
|
3781
|
+
# @macro pWebhookToken
|
3782
|
+
# @macro pMessageID
|
2553
3783
|
# @macro pBody
|
2554
3784
|
# @macro pQuery
|
3785
|
+
# @macro pReason
|
2555
3786
|
# @macro rResponse
|
2556
3787
|
#
|
2557
3788
|
# @see https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
2558
3789
|
# Discord documentation "Edit Webhook Message"
|
2559
|
-
def edit_webhook_message(webhook_id, webhook_token, message_id, body, query = {})
|
2560
|
-
json_request(
|
3790
|
+
def edit_webhook_message(webhook_id, webhook_token, message_id, body, query = {}, reason: nil)
|
3791
|
+
json_request(
|
3792
|
+
:patch,
|
3793
|
+
discord("/webhooks/#{webhook_id}/#{webhook_token}/messages/#{message_id}"),
|
3794
|
+
body:,
|
3795
|
+
query:,
|
3796
|
+
headers: auditlog(reason)
|
3797
|
+
)
|
2561
3798
|
end
|
2562
3799
|
|
2563
3800
|
##
|
2564
|
-
# @
|
2565
|
-
# @
|
2566
|
-
# @
|
3801
|
+
# @macro pWebhookID
|
3802
|
+
# @macro pWebhookToken
|
3803
|
+
# @macro pMessageID
|
3804
|
+
# @macro pReason
|
2567
3805
|
# @macro rResponse
|
2568
3806
|
#
|
2569
3807
|
# @see https://discord.com/developers/docs/resources/webhook#delete-webhook-message
|
2570
3808
|
# Discord documentation "Delete Webhook Message"
|
2571
|
-
def delete_webhook_message(webhook_id, webhook_token, message_id)
|
2572
|
-
json_request(
|
3809
|
+
def delete_webhook_message(webhook_id, webhook_token, message_id, reason: nil)
|
3810
|
+
json_request(
|
3811
|
+
:delete,
|
3812
|
+
discord("/webhooks/#{webhook_id}/#{webhook_token}/messages/#{message_id}"),
|
3813
|
+
headers: auditlog(reason)
|
3814
|
+
)
|
2573
3815
|
end
|
2574
3816
|
|
2575
3817
|
### }}} Webhook
|
@@ -2577,8 +3819,8 @@ module LibDiscord
|
|
2577
3819
|
### OAuth2 {{{
|
2578
3820
|
|
2579
3821
|
##
|
2580
|
-
# @
|
2581
|
-
# @
|
3822
|
+
# @macro pHttpUser
|
3823
|
+
# @macro pHttpPass
|
2582
3824
|
# @macro pQuery
|
2583
3825
|
# @macro rResponse
|
2584
3826
|
def oauth2_request_token(user, pass, query)
|
@@ -2594,8 +3836,8 @@ module LibDiscord
|
|
2594
3836
|
end
|
2595
3837
|
|
2596
3838
|
##
|
2597
|
-
# @
|
2598
|
-
# @
|
3839
|
+
# @macro pHttpUser
|
3840
|
+
# @macro pHttpPass
|
2599
3841
|
# @macro pQuery
|
2600
3842
|
# @macro rResponse
|
2601
3843
|
#
|
@@ -2641,6 +3883,16 @@ module LibDiscord
|
|
2641
3883
|
|
2642
3884
|
private
|
2643
3885
|
|
3886
|
+
# NOTE: Discord's documentation is not explicit in which endpoints support
|
3887
|
+
# the audit log reason header, but I believe we can infer from the Audit
|
3888
|
+
# Log Events table.
|
3889
|
+
# https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events
|
3890
|
+
def auditlog(reason)
|
3891
|
+
return {} unless reason
|
3892
|
+
|
3893
|
+
{"X-Audit-Log-Reason" => reason.to_s}
|
3894
|
+
end
|
3895
|
+
|
2644
3896
|
def base64_strictencode(input) = [input].pack("m0")
|
2645
3897
|
|
2646
3898
|
def discord(path, prefix: "/api/v10")
|