lib_discord 0.1.3 → 1.0.1
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/CONTRIBUTING.md +88 -0
- data/README.md +40 -67
- data/lib/lib_discord/client.rb +2667 -138
- data/lib/lib_discord/formatter.rb +108 -0
- data/lib/lib_discord/maps.rb +730 -0
- data/lib/lib_discord/permissions.rb +84 -0
- data/lib/lib_discord/urls.rb +9 -15
- data/lib/lib_discord/version.rb +1 -4
- data/lib/lib_discord.rb +3 -5
- metadata +12 -120
- data/CHANGELOG.md +0 -152
- data/lib/lib_discord/application.rb +0 -43
- data/lib/lib_discord/application_command.rb +0 -341
- data/lib/lib_discord/application_role_connection_metadata.rb +0 -52
- data/lib/lib_discord/audit_log.rb +0 -36
- data/lib/lib_discord/auto_moderation.rb +0 -106
- data/lib/lib_discord/channel.rb +0 -716
- data/lib/lib_discord/emoji.rb +0 -106
- data/lib/lib_discord/errors.rb +0 -31
- data/lib/lib_discord/guild.rb +0 -830
- data/lib/lib_discord/guild_scheduled_event.rb +0 -133
- data/lib/lib_discord/guild_template.rb +0 -128
- data/lib/lib_discord/interaction.rb +0 -163
- data/lib/lib_discord/invite.rb +0 -47
- data/lib/lib_discord/mappers/application_command_option_types.rb +0 -22
- data/lib/lib_discord/mappers/application_command_permission_types.rb +0 -14
- data/lib/lib_discord/mappers/application_command_types.rb +0 -14
- data/lib/lib_discord/mappers/application_integration_types.rb +0 -13
- data/lib/lib_discord/mappers/application_role_connection_metadata_types.rb +0 -19
- data/lib/lib_discord/mappers/audit_log_events.rb +0 -67
- data/lib/lib_discord/mappers/auto_moderation_action_types.rb +0 -14
- data/lib/lib_discord/mappers/auto_moderation_event_types.rb +0 -12
- data/lib/lib_discord/mappers/auto_moderation_keyword_preset_types.rb +0 -14
- data/lib/lib_discord/mappers/auto_moderation_trigger_types.rb +0 -15
- data/lib/lib_discord/mappers/channel_forum_layout_types.rb +0 -14
- data/lib/lib_discord/mappers/channel_message_activity_types.rb +0 -15
- data/lib/lib_discord/mappers/channel_message_types.rb +0 -42
- data/lib/lib_discord/mappers/channel_sort_order_types.rb +0 -13
- data/lib/lib_discord/mappers/channel_types.rb +0 -24
- data/lib/lib_discord/mappers/channel_video_quality_modes.rb +0 -13
- data/lib/lib_discord/mappers/guild_default_message_notification_levels.rb +0 -13
- data/lib/lib_discord/mappers/guild_explicit_content_filter_levels.rb +0 -14
- data/lib/lib_discord/mappers/guild_integration_expire_behaviors.rb +0 -13
- data/lib/lib_discord/mappers/guild_mfa_levels.rb +0 -13
- data/lib/lib_discord/mappers/guild_nsfw_levels.rb +0 -15
- data/lib/lib_discord/mappers/guild_onboarding_modes.rb +0 -13
- data/lib/lib_discord/mappers/guild_premium_tiers.rb +0 -15
- data/lib/lib_discord/mappers/guild_prompt_types.rb +0 -13
- data/lib/lib_discord/mappers/guild_scheduled_event_entity_types.rb +0 -14
- data/lib/lib_discord/mappers/guild_scheduled_event_privacy_levels.rb +0 -12
- data/lib/lib_discord/mappers/guild_scheduled_event_statuses.rb +0 -15
- data/lib/lib_discord/mappers/guild_verification_levels.rb +0 -16
- data/lib/lib_discord/mappers/interaction_callback_types.rb +0 -19
- data/lib/lib_discord/mappers/interaction_context_types.rb +0 -14
- data/lib/lib_discord/mappers/interaction_types.rb +0 -16
- data/lib/lib_discord/mappers/invite_target_types.rb +0 -13
- data/lib/lib_discord/mappers/message_component_button_styles.rb +0 -16
- data/lib/lib_discord/mappers/message_component_text_input_styles.rb +0 -13
- data/lib/lib_discord/mappers/message_component_types.rb +0 -19
- data/lib/lib_discord/mappers/poll_layout_types.rb +0 -12
- data/lib/lib_discord/mappers/stage_instance_privacy_levels.rb +0 -13
- data/lib/lib_discord/mappers/sticker_format_types.rb +0 -15
- data/lib/lib_discord/mappers/sticker_types.rb +0 -13
- data/lib/lib_discord/mappers/user_premium_types.rb +0 -15
- data/lib/lib_discord/mappers/user_visibility_types.rb +0 -13
- data/lib/lib_discord/mappers/webhooks_types.rb +0 -14
- data/lib/lib_discord/mappers.rb +0 -87
- data/lib/lib_discord/poll.rb +0 -62
- data/lib/lib_discord/resource.rb +0 -133
- data/lib/lib_discord/response.rb +0 -43
- data/lib/lib_discord/stage_instance.rb +0 -79
- data/lib/lib_discord/sticker.rb +0 -132
- data/lib/lib_discord/types.rb +0 -47
- data/lib/lib_discord/user.rb +0 -174
- data/lib/lib_discord/voice.rb +0 -29
- data/lib/lib_discord/webhook.rb +0 -299
@@ -1,341 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lib_discord/resource"
|
4
|
-
|
5
|
-
module LibDiscord
|
6
|
-
##
|
7
|
-
# Application Commands
|
8
|
-
#
|
9
|
-
# Do not instantiate an {ApplicationCommand} directly. Instead request one
|
10
|
-
# from an instance of {Client}.
|
11
|
-
#
|
12
|
-
# client = LibDiscord::Client.new("Bot auth.token")
|
13
|
-
# a = client["application_command"]
|
14
|
-
#
|
15
|
-
# @see https://discord.com/developers/docs/interactions/application-commands
|
16
|
-
# Discord documentation "Application Commands"
|
17
|
-
# @see https://discord.com/developers/docs/interactions/application-commands#permissions
|
18
|
-
# Discord documentation "Permissions"
|
19
|
-
class ApplicationCommand < Resource
|
20
|
-
##
|
21
|
-
# @param application_id [#to_s]
|
22
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
23
|
-
# documentation "Snowflakes"}
|
24
|
-
# @param params [Hash] optional HTTP query parameters
|
25
|
-
#
|
26
|
-
# @return [Response]
|
27
|
-
#
|
28
|
-
# @raise [TimeoutError] if the HTTP request times out
|
29
|
-
# @raise [ConstraintError] if +params+ cannot be coerced into a valid query
|
30
|
-
# parameters string
|
31
|
-
#
|
32
|
-
# @see https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands
|
33
|
-
# Discord documentation "Get Global Application Commands"
|
34
|
-
def get_global_application_commands(application_id:, params: {})
|
35
|
-
send_request(:get, "/applications/#{application_id}/commands", params:)
|
36
|
-
end
|
37
|
-
|
38
|
-
##
|
39
|
-
# @param application_id [#to_s]
|
40
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
41
|
-
# documentation "Snowflakes"}
|
42
|
-
# @param json [#to_json] JSON serializable payload
|
43
|
-
#
|
44
|
-
# @return [Response]
|
45
|
-
#
|
46
|
-
# @raise [TimeoutError] if the HTTP request times out
|
47
|
-
# @raise [ConstraintError] if +json+ cannot be serialized to JSON
|
48
|
-
#
|
49
|
-
# @see https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
|
50
|
-
# Discord documentation "Create Global Application Command"
|
51
|
-
def create_global_application_command(application_id:, json:)
|
52
|
-
send_request(:post, "/applications/#{application_id}/commands", json:)
|
53
|
-
end
|
54
|
-
|
55
|
-
##
|
56
|
-
# @param application_id [#to_s]
|
57
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
58
|
-
# documentation "Snowflakes"}
|
59
|
-
# @param command_id [#to_s]
|
60
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
61
|
-
# documentation "Snowflakes"}
|
62
|
-
#
|
63
|
-
# @return [Response]
|
64
|
-
#
|
65
|
-
# @raise [TimeoutError] if the HTTP request times out
|
66
|
-
#
|
67
|
-
# @see https://discord.com/developers/docs/interactions/application-commands#get-global-application-command
|
68
|
-
# Discord documentation "Get Global Application Command"
|
69
|
-
def get_global_application_command(application_id:, command_id:)
|
70
|
-
send_request(:get, "/applications/#{application_id}/commands/#{command_id}")
|
71
|
-
end
|
72
|
-
|
73
|
-
##
|
74
|
-
# @param application_id [#to_s]
|
75
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
76
|
-
# documentation "Snowflakes"}
|
77
|
-
# @param command_id [#to_s]
|
78
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
79
|
-
# documentation "Snowflakes"}
|
80
|
-
# @param json [#to_json] JSON serializable payload
|
81
|
-
#
|
82
|
-
# @return [Response]
|
83
|
-
#
|
84
|
-
# @raise [TimeoutError] if the HTTP request times out
|
85
|
-
# @raise [ConstraintError] if +json+ cannot be serialized to JSON
|
86
|
-
#
|
87
|
-
# @see https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command
|
88
|
-
# Discord documentation "Edit Global Application Command"
|
89
|
-
def edit_global_application_command(application_id:, command_id:, json:)
|
90
|
-
send_request(:patch, "/applications/#{application_id}/commands/#{command_id}", json:)
|
91
|
-
end
|
92
|
-
|
93
|
-
##
|
94
|
-
# @param application_id [#to_s]
|
95
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
96
|
-
# documentation "Snowflakes"}
|
97
|
-
# @param command_id [#to_s]
|
98
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
99
|
-
# documentation "Snowflakes"}
|
100
|
-
#
|
101
|
-
# @return [Response]
|
102
|
-
#
|
103
|
-
# @raise [TimeoutError] if the HTTP request times out
|
104
|
-
#
|
105
|
-
# @see https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command
|
106
|
-
# Discord documentation "Delete Global Application Command"
|
107
|
-
def delete_global_application_command(application_id:, command_id:)
|
108
|
-
send_request(:delete, "/applications/#{application_id}/commands/#{command_id}")
|
109
|
-
end
|
110
|
-
|
111
|
-
##
|
112
|
-
# @param application_id [#to_s]
|
113
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
114
|
-
# documentation "Snowflakes"}
|
115
|
-
# @param json [#to_json] JSON serializable payload
|
116
|
-
#
|
117
|
-
# @return [Response]
|
118
|
-
#
|
119
|
-
# @raise [TimeoutError] if the HTTP request times out
|
120
|
-
# @raise [ConstraintError] if +json+ cannot be serialized to JSON
|
121
|
-
#
|
122
|
-
# @see https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands
|
123
|
-
# Discord documentation "Bulk Overwrite Global Application Commands"
|
124
|
-
def bulk_overwrite_global_application_commands(application_id:, json:)
|
125
|
-
send_request(:put, "/applications/#{application_id}/commands", json:)
|
126
|
-
end
|
127
|
-
|
128
|
-
##
|
129
|
-
# @param application_id [#to_s]
|
130
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
131
|
-
# documentation "Snowflakes"}
|
132
|
-
# @param guild_id [#to_s]
|
133
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
134
|
-
# documentation "Snowflakes"}
|
135
|
-
# @param params [Hash] optional HTTP query parameters
|
136
|
-
#
|
137
|
-
# @return [Response]
|
138
|
-
#
|
139
|
-
# @raise [TimeoutError] if the HTTP request times outs
|
140
|
-
# @raise [ConstraintError] if +params+ cannot be coerced into a valid query
|
141
|
-
# parameters string
|
142
|
-
#
|
143
|
-
# @see https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands
|
144
|
-
# Discord documentation "Get Guild Application Commands"
|
145
|
-
def get_guild_application_commands(application_id:, guild_id:, params: {})
|
146
|
-
send_request(:get, "/applications/#{application_id}/guilds/#{guild_id}/commands", params:)
|
147
|
-
end
|
148
|
-
|
149
|
-
##
|
150
|
-
# @param application_id [#to_s]
|
151
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
152
|
-
# documentation "Snowflakes"}
|
153
|
-
# @param guild_id [#to_s]
|
154
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
155
|
-
# documentation "Snowflakes"}
|
156
|
-
# @param json [#to_json] JSON serializable payload
|
157
|
-
#
|
158
|
-
# @return [Response]
|
159
|
-
#
|
160
|
-
# @raise [TimeoutError] if the HTTP request times out
|
161
|
-
# @raise [ConstraintError] if +json+ cannot be serialized to JSON
|
162
|
-
#
|
163
|
-
# @see https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command
|
164
|
-
# Discord documentation "Create Guild Application Command"
|
165
|
-
def create_guild_application_command(application_id:, guild_id:, json:)
|
166
|
-
send_request(:post, "/applications/#{application_id}/guilds/#{guild_id}/commands", json:)
|
167
|
-
end
|
168
|
-
|
169
|
-
##
|
170
|
-
# @param application_id [#to_s]
|
171
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
172
|
-
# documentation "Snowflakes"}
|
173
|
-
# @param guild_id [#to_s]
|
174
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
175
|
-
# documentation "Snowflakes"}
|
176
|
-
# @param command_id [#to_s]
|
177
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
178
|
-
# documentation "Snowflakes"}
|
179
|
-
#
|
180
|
-
# @return [Response]
|
181
|
-
#
|
182
|
-
# @raise [TimeoutError] if the HTTP request times out
|
183
|
-
#
|
184
|
-
# @see https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command
|
185
|
-
# Discord documentation "Get Guild Application Command"
|
186
|
-
def get_guild_application_command(application_id:, guild_id:, command_id:)
|
187
|
-
send_request(:get, "/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}")
|
188
|
-
end
|
189
|
-
|
190
|
-
##
|
191
|
-
# @param application_id [#to_s]
|
192
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
193
|
-
# documentation "Snowflakes"}
|
194
|
-
# @param guild_id [#to_s]
|
195
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
196
|
-
# documentation "Snowflakes"}
|
197
|
-
# @param command_id [#to_s]
|
198
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
199
|
-
# documentation "Snowflakes"}
|
200
|
-
# @param json [#to_json] JSON serializable payload
|
201
|
-
#
|
202
|
-
# @return [Response]
|
203
|
-
#
|
204
|
-
# @raise [TimeoutError] if the HTTP request times out
|
205
|
-
# @raise [ConstraintError] if +json+ cannot be serialized to JSON
|
206
|
-
#
|
207
|
-
# @see https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command
|
208
|
-
# Discord documentation "Edit Guild Application Command"
|
209
|
-
def edit_guild_application_command(application_id:, guild_id:, command_id:, json:)
|
210
|
-
send_request(:patch, "/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}", json:)
|
211
|
-
end
|
212
|
-
|
213
|
-
##
|
214
|
-
# @param application_id [#to_s]
|
215
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
216
|
-
# documentation "Snowflakes"}
|
217
|
-
# @param guild_id [#to_s]
|
218
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
219
|
-
# documentation "Snowflakes"}
|
220
|
-
# @param command_id [#to_s]
|
221
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
222
|
-
# documentation "Snowflakes"}
|
223
|
-
#
|
224
|
-
# @return [Response]
|
225
|
-
#
|
226
|
-
# @raise [TimeoutError] if the HTTP request times out
|
227
|
-
#
|
228
|
-
# @see https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command
|
229
|
-
# Discord documentation "Delete Guild Application Command"
|
230
|
-
def delete_guild_application_command(application_id:, guild_id:, command_id:)
|
231
|
-
send_request(:delete, "/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}")
|
232
|
-
end
|
233
|
-
|
234
|
-
##
|
235
|
-
# @param application_id [#to_s]
|
236
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
237
|
-
# documentation "Snowflakes"}
|
238
|
-
# @param guild_id [#to_s]
|
239
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
240
|
-
# documentation "Snowflakes"}
|
241
|
-
# @param json [#to_json] JSON serializable payload
|
242
|
-
#
|
243
|
-
# @return [Response]
|
244
|
-
#
|
245
|
-
# @raise [TimeoutError] if the HTTP request times out
|
246
|
-
# @raise [ConstraintError] if +json+ cannot be serialized to JSON
|
247
|
-
#
|
248
|
-
# @see https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands
|
249
|
-
# Discord documentation "Bulk Overwrite Guild Application Commands"
|
250
|
-
def bulk_overwrite_guild_application_commands(application_id:, guild_id:, json:)
|
251
|
-
send_request(:put, "/applications/#{application_id}/guilds/#{guild_id}/commands", json:)
|
252
|
-
end
|
253
|
-
|
254
|
-
##
|
255
|
-
# @param application_id [#to_s]
|
256
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
257
|
-
# documentation "Snowflakes"}
|
258
|
-
# @param guild_id [#to_s]
|
259
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
260
|
-
# documentation "Snowflakes"}
|
261
|
-
#
|
262
|
-
# @return [Response]
|
263
|
-
#
|
264
|
-
# @raise [TimeoutError] if the HTTP request times out
|
265
|
-
#
|
266
|
-
# @see https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions
|
267
|
-
# Discord documentation "Get Guild Application Command Permissions"
|
268
|
-
def get_guild_application_command_permissions(application_id:, guild_id:)
|
269
|
-
send_request(:get, "/applications/#{application_id}/guilds/#{guild_id}/commands/permissions")
|
270
|
-
end
|
271
|
-
|
272
|
-
##
|
273
|
-
# @param application_id [#to_s]
|
274
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
275
|
-
# documentation "Snowflakes"}
|
276
|
-
# @param guild_id [#to_s]
|
277
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
278
|
-
# documentation "Snowflakes"}
|
279
|
-
# @param command_id [#to_s]
|
280
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
281
|
-
# documentation "Snowflakes"}
|
282
|
-
#
|
283
|
-
# @raise [TimeoutError] if the HTTP request times out
|
284
|
-
#
|
285
|
-
# @see https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions
|
286
|
-
# Discord documentation "Get Application Command Permissions"
|
287
|
-
def get_application_command_permissions(application_id:, guild_id:, command_id:)
|
288
|
-
send_request(:get, "/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}/permissions")
|
289
|
-
end
|
290
|
-
|
291
|
-
##
|
292
|
-
# @param application_id [#to_s]
|
293
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
294
|
-
# documentation "Snowflakes"}
|
295
|
-
# @param guild_id [#to_s]
|
296
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
297
|
-
# documentation "Snowflakes"}
|
298
|
-
# @param command_id [#to_s]
|
299
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
300
|
-
# documentation "Snowflakes"}
|
301
|
-
# @param json [#to_json] JSON serializable payload
|
302
|
-
#
|
303
|
-
# @return [Response]
|
304
|
-
#
|
305
|
-
# @raise [TimeoutError] if the HTTP request times out
|
306
|
-
# @raise [ConstraintError] if +json+ cannot be serialized to JSON
|
307
|
-
#
|
308
|
-
# @see https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions
|
309
|
-
# Discord documentation "Edit Application Command Permissions"
|
310
|
-
def edit_application_command_permissions(application_id:, guild_id:, command_id:, json:)
|
311
|
-
send_request(:put, "/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}/permissions", json:)
|
312
|
-
end
|
313
|
-
|
314
|
-
##
|
315
|
-
# @deprecated This endpoint has been disabled with
|
316
|
-
# {https://discord.com/developers/docs/change-log#updated-command-permissions
|
317
|
-
# updates to command permissions (Permissions v2)}. Instead, you can
|
318
|
-
# {#edit_application_command_permissions edit each application command
|
319
|
-
# permissions} (though you should be careful to handle any potential
|
320
|
-
# {https://discord.com/developers/docs/topics/rate-limits rate limits}).
|
321
|
-
#
|
322
|
-
# @param application_id [#to_s]
|
323
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
324
|
-
# documentation "Snowflakes"}
|
325
|
-
# @param guild_id [#to_s]
|
326
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
327
|
-
# documentation "Snowflakes"}
|
328
|
-
# @param json [#to_json] JSON serializable payload
|
329
|
-
#
|
330
|
-
# @return [Response]
|
331
|
-
#
|
332
|
-
# @raise [TimeoutError] if the HTTP request times out
|
333
|
-
# @raise [ConstraintError] if +json+ cannot be serialized to JSON
|
334
|
-
#
|
335
|
-
# @see https://discord.com/developers/docs/interactions/application-commands#batch-edit-application-command-permissions
|
336
|
-
# Discord documentation "Batch Edit Application Command Permissions"
|
337
|
-
def batch_edit_application_command_permissions(application_id:, guild_id:, json:)
|
338
|
-
send_request(:put, "/applications/#{application_id}/guilds/#{guild_id}/commands/permissions", json:)
|
339
|
-
end
|
340
|
-
end
|
341
|
-
end
|
@@ -1,52 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lib_discord/resource"
|
4
|
-
|
5
|
-
module LibDiscord
|
6
|
-
##
|
7
|
-
# Application Role Connection Metadata
|
8
|
-
#
|
9
|
-
# Do not instantiate an {ApplicationRoleConnectionMetadata} directly. Instead
|
10
|
-
# request one from an instance of {Client}.
|
11
|
-
#
|
12
|
-
# client = LibDiscord::Client.new("Bot auth.token")
|
13
|
-
# a = client["application_role_connection_metadata"]
|
14
|
-
#
|
15
|
-
# @see https://discord.com/developers/docs/resources/application-role-connection-metadata
|
16
|
-
# Discord documentation "Application Role Connection Metadata"
|
17
|
-
class ApplicationRoleConnectionMetadata < Resource
|
18
|
-
##
|
19
|
-
# @param application_id [#to_s]
|
20
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
21
|
-
# documentation "Snowflakes"}
|
22
|
-
#
|
23
|
-
# @return [Response]
|
24
|
-
#
|
25
|
-
# @raise [TimeoutError] if the HTTP request times out
|
26
|
-
#
|
27
|
-
# @see https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
|
28
|
-
# Discord documentation "Get Application Role Connection Metadata
|
29
|
-
# Records"
|
30
|
-
def get_application_role_connection_metadata_records(application_id:)
|
31
|
-
send_request(:get, "/applications/#{application_id}/role-connections/metadata")
|
32
|
-
end
|
33
|
-
|
34
|
-
##
|
35
|
-
# @param application_id [#to_s]
|
36
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
37
|
-
# documentation "Snowflakes"}
|
38
|
-
# @param json [#to_json] JSON serializable payload
|
39
|
-
#
|
40
|
-
# @return [Response]
|
41
|
-
#
|
42
|
-
# @raise [TimeoutError] if the HTTP request times out
|
43
|
-
# @raise [ConstraintError] if +json+ cannot be serialized to JSON
|
44
|
-
#
|
45
|
-
# @see https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
|
46
|
-
# Discord documentation "Update Application Role Connection Metadata
|
47
|
-
# Records"
|
48
|
-
def update_application_role_connection_metadata_records(application_id:, json:)
|
49
|
-
send_request(:put, "/applications/#{application_id}/role-connections/metadata", json:)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lib_discord/resource"
|
4
|
-
|
5
|
-
module LibDiscord
|
6
|
-
##
|
7
|
-
# Audit Logs Resource
|
8
|
-
#
|
9
|
-
# Do not instantiate an {AuditLog} directly. Instead request one from an
|
10
|
-
# instance of {Client}.
|
11
|
-
#
|
12
|
-
# client = LibDiscord::Client.new("Bot auth.token")
|
13
|
-
# a = client["audit_log"]
|
14
|
-
#
|
15
|
-
# @see https://discord.com/developers/docs/resources/audit-log#audit-logs-resource
|
16
|
-
# Discord documentation "Audit Logs Resource"
|
17
|
-
class AuditLog < Resource
|
18
|
-
##
|
19
|
-
# @param guild_id [#to_s]
|
20
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
21
|
-
# documentation "Snowflakes"}
|
22
|
-
# @param params [Hash] optional HTTP query parameters
|
23
|
-
#
|
24
|
-
# @return [Response]
|
25
|
-
#
|
26
|
-
# @raise [TimeoutError] if the HTTP request times out
|
27
|
-
# @raise [ConstraintError] if +params+ cannot be coerced into a valid query
|
28
|
-
# parameters string
|
29
|
-
#
|
30
|
-
# @see https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log
|
31
|
-
# Discord documentation "Get Guild Audit Log"
|
32
|
-
def get_guild_audit_log(guild_id:, params: {})
|
33
|
-
send_request(:get, "/guilds/#{guild_id}/audit-logs", params:)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,106 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lib_discord/resource"
|
4
|
-
|
5
|
-
module LibDiscord
|
6
|
-
##
|
7
|
-
# Auto Moderation
|
8
|
-
#
|
9
|
-
# Do not instantiate an {AutoModeration} directly. Instead request one from
|
10
|
-
# an instance of {Client}.
|
11
|
-
#
|
12
|
-
# client = LibDiscord::Client.new("Bot auth.token")
|
13
|
-
# a = client["auto_moderation"]
|
14
|
-
#
|
15
|
-
# @see https://discord.com/developers/docs/resources/auto-moderation Discord
|
16
|
-
# documentation "Auto Moderation"
|
17
|
-
class AutoModeration < Resource
|
18
|
-
##
|
19
|
-
# @param guild_id [#to_s]
|
20
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
21
|
-
# documentation "Snowflakes"}
|
22
|
-
#
|
23
|
-
# @return [Response]
|
24
|
-
#
|
25
|
-
# @raise [TimeoutError] if the HTTP request times out
|
26
|
-
#
|
27
|
-
# @see https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild
|
28
|
-
# Discord documentation "List Auto Moderation Rules for Guild"
|
29
|
-
def list_auto_moderation_rules_for_guild(guild_id:)
|
30
|
-
send_request(:get, "/guilds/#{guild_id}/auto-moderation/rules")
|
31
|
-
end
|
32
|
-
|
33
|
-
##
|
34
|
-
# @param guild_id [#to_s]
|
35
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
36
|
-
# documentation "Snowflakes"}
|
37
|
-
# @param auto_moderation_rule_id [#to_s]
|
38
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
39
|
-
# documentation "Snowflakes"}
|
40
|
-
#
|
41
|
-
# @return [Response]
|
42
|
-
#
|
43
|
-
# @raise [TimeoutError] if the HTTP request times out
|
44
|
-
#
|
45
|
-
# @see https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule
|
46
|
-
# Discord documentation "Get Auto Moderation Rule"
|
47
|
-
def get_auto_moderation_rule(guild_id:, auto_moderation_rule_id:)
|
48
|
-
send_request(:get, "/guilds/#{guild_id}/auto-moderation/rules/#{auto_moderation_rule_id}")
|
49
|
-
end
|
50
|
-
|
51
|
-
##
|
52
|
-
# @param guild_id [#to_s]
|
53
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
54
|
-
# documentation "Snowflakes"}
|
55
|
-
# @param json [#to_json] JSON serializable payload
|
56
|
-
#
|
57
|
-
# @return [Response]
|
58
|
-
#
|
59
|
-
# @raise [TimeoutError] if the HTTP request times out
|
60
|
-
# @raise [ConstraintError] if +json+ cannot be serialized to JSON
|
61
|
-
#
|
62
|
-
# @see https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
|
63
|
-
# Discord documentation "Create Auto Moderation Rule"
|
64
|
-
def create_auto_moderation_rule(guild_id:, json:)
|
65
|
-
send_request(:post, "/guilds/#{guild_id}/auto-moderation/rules", json:)
|
66
|
-
end
|
67
|
-
|
68
|
-
##
|
69
|
-
# @param guild_id [#to_s]
|
70
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
71
|
-
# documentation "Snowflakes"}
|
72
|
-
# @param auto_moderation_rule_id [#to_s]
|
73
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
74
|
-
# documentation "Snowflakes"}
|
75
|
-
# @param json [#to_json] JSON serializable payload
|
76
|
-
#
|
77
|
-
# @return [Response]
|
78
|
-
#
|
79
|
-
# @raise [TimeoutError] if the HTTP request times out
|
80
|
-
# @raise [ConstraintError] if +json+ cannot be serialized to JSON
|
81
|
-
#
|
82
|
-
# @see https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule
|
83
|
-
# Discord documentation "Modify Auto Moderation Rule"
|
84
|
-
def modify_auto_moderation_rule(guild_id:, auto_moderation_rule_id:, json:)
|
85
|
-
send_request(:patch, "/guilds/#{guild_id}/auto-moderation/rules/#{auto_moderation_rule_id}", json:)
|
86
|
-
end
|
87
|
-
|
88
|
-
##
|
89
|
-
# @param guild_id [#to_s]
|
90
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
91
|
-
# documentation "Snowflakes"}
|
92
|
-
# @param auto_moderation_rule_id [#to_s]
|
93
|
-
# {https://discord.com/developers/docs/reference#snowflakes Discord
|
94
|
-
# documentation "Snowflakes"}
|
95
|
-
#
|
96
|
-
# @return [Response]
|
97
|
-
#
|
98
|
-
# @raise [TimeoutError] if the HTTP request times out
|
99
|
-
#
|
100
|
-
# @see https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule
|
101
|
-
# Discord documentation "Delete Auto Moderation Rule"
|
102
|
-
def delete_auto_moderation_rule(guild_id:, auto_moderation_rule_id:)
|
103
|
-
send_request(:delete, "/guilds/#{guild_id}/auto-moderation/rules/#{auto_moderation_rule_id}")
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|