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