disrb 0.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 +7 -0
- data/LICENSE +7 -0
- data/README.md +7 -0
- data/lib/disrb/guild.rb +743 -0
- data/lib/disrb/logger.rb +65 -0
- data/lib/disrb/message.rb +36 -0
- data/lib/disrb/user.rb +147 -0
- data/lib/disrb.rb +637 -0
- metadata +104 -0
data/lib/disrb/guild.rb
ADDED
|
@@ -0,0 +1,743 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# DiscordApi
|
|
4
|
+
# The class that contains everything that interacts with the Discord API.
|
|
5
|
+
class DiscordApi
|
|
6
|
+
def create_guild(name, region = nil, icon = nil, verification_level = nil, default_message_notifications = nil,
|
|
7
|
+
explicit_content_filter = nil, roles = nil, channels = nil, afk_channel_id = nil, afk_timeout = nil,
|
|
8
|
+
system_channel_id = nil, system_channel_flags = nil)
|
|
9
|
+
output = {}
|
|
10
|
+
output[:name] = name
|
|
11
|
+
unless region.nil?
|
|
12
|
+
@logger.warn('The "region" parameter has been deprecated and should not be used!')
|
|
13
|
+
output[:region] = region
|
|
14
|
+
end
|
|
15
|
+
output[:icon] = icon unless icon.nil?
|
|
16
|
+
output[:verification_level] = verification_level unless verification_level.nil?
|
|
17
|
+
output[:default_message_notifications] = default_message_notifications unless default_message_notifications.nil?
|
|
18
|
+
output[:explicit_content_filter] = explicit_content_filter unless explicit_content_filter.nil?
|
|
19
|
+
output[:roles] = roles unless roles.nil?
|
|
20
|
+
output[:channels] = channels unless channels.nil?
|
|
21
|
+
output[:afk_channel_id] = afk_channel_id unless afk_channel_id.nil?
|
|
22
|
+
output[:afk_timeout] = afk_timeout unless afk_timeout.nil?
|
|
23
|
+
output[:system_channel_id] = system_channel_id unless system_channel_id.nil?
|
|
24
|
+
output[:system_channel_flags] = system_channel_flags unless system_channel_flags.nil?
|
|
25
|
+
url = URI("#{@base_url}/guilds")
|
|
26
|
+
data = JSON.generate(output)
|
|
27
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
28
|
+
response = Net::HTTP.post(url, data, headers)
|
|
29
|
+
return response unless response.code != '200'
|
|
30
|
+
|
|
31
|
+
@logger.error("Could not create guild. Response: #{response.body}")
|
|
32
|
+
response
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def get_guild(guild_id, with_counts = nil)
|
|
36
|
+
url = if !with_counts.nil?
|
|
37
|
+
"#{@base_url}/guilds/#{guild_id}?with_counts=#{with_counts}"
|
|
38
|
+
else
|
|
39
|
+
"#{@base_url}/guilds/#{guild_id}"
|
|
40
|
+
end
|
|
41
|
+
headers = { 'Authorization' => @authorization_header }
|
|
42
|
+
response = DiscordApi.get(url, headers)
|
|
43
|
+
return response unless response.status != 200
|
|
44
|
+
|
|
45
|
+
@logger.error("Could not get guild with Guild ID #{guild_id}. Response: #{response.body}")
|
|
46
|
+
response
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def get_guild_preview(guild_id)
|
|
50
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/preview")
|
|
51
|
+
headers = { 'Authorization': @authorization_header }
|
|
52
|
+
response = Net::HTTP.get(url, headers)
|
|
53
|
+
return response unless response.code != '200'
|
|
54
|
+
|
|
55
|
+
@logger.error("Could not get guild preview with Guild ID #{guild_id}. Response: #{response.body}")
|
|
56
|
+
response
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def modify_guild(guild_id, name = nil, region = nil, verification_level = nil, default_message_notifications = nil,
|
|
60
|
+
explicit_content_filter = nil, afk_channel_id = nil, afk_timeout = nil, icon = nil, owner_id = nil,
|
|
61
|
+
splash = nil, discovery_splash = nil, banner = nil, system_channel_id = nil,
|
|
62
|
+
system_channel_flags = nil, rules_channel_id = nil, public_updates_channel_id = nil,
|
|
63
|
+
preferred_locale = nil, features = nil, description = nil, premium_progress_bar_enabled = nil,
|
|
64
|
+
safety_alerts_channel_id = nil, audit_reason = nil)
|
|
65
|
+
output = {}
|
|
66
|
+
output[:name] = name unless name.nil?
|
|
67
|
+
unless region.nil?
|
|
68
|
+
@logger.warn('The "region" parameter has been deprecated and should not be used!')
|
|
69
|
+
output[:region] = region
|
|
70
|
+
end
|
|
71
|
+
output[:verification_level] = verification_level unless verification_level.nil?
|
|
72
|
+
output[:default_message_notifications] = default_message_notifications unless default_message_notifications.nil?
|
|
73
|
+
output[:explicit_content_filter] = explicit_content_filter unless explicit_content_filter.nil?
|
|
74
|
+
output[:afk_channel_id] = afk_channel_id unless afk_channel_id.nil?
|
|
75
|
+
output[:afk_timeout] = afk_timeout unless afk_timeout.nil?
|
|
76
|
+
output[:icon] = icon unless icon.nil?
|
|
77
|
+
output[:owner_id] = owner_id unless owner_id.nil?
|
|
78
|
+
output[:splash] = splash unless splash.nil?
|
|
79
|
+
output[:discovery_splash] = discovery_splash unless discovery_splash.nil?
|
|
80
|
+
output[:banner] = banner unless banner.nil?
|
|
81
|
+
output[:system_channel_id] = system_channel_id unless system_channel_id.nil?
|
|
82
|
+
output[:system_channel_flags] = system_channel_flags unless system_channel_flags.nil?
|
|
83
|
+
output[:rules_channel_id] = rules_channel_id unless rules_channel_id.nil?
|
|
84
|
+
output[:public_updates_channel_id] = public_updates_channel_id unless public_updates_channel_id.nil?
|
|
85
|
+
output[:preferred_locale] = preferred_locale unless preferred_locale.nil?
|
|
86
|
+
output[:features] = features unless features.nil?
|
|
87
|
+
output[:description] = description unless description.nil?
|
|
88
|
+
output[:premium_progress_bar_enabled] = !premium_progress_bar_enabled.nil?
|
|
89
|
+
output[:safety_alerts_channel_id] = safety_alerts_channel_id unless safety_alerts_channel_id.nil?
|
|
90
|
+
url = URI("#{@base_url}/guilds/#{guild_id}")
|
|
91
|
+
data = JSON.generate(output)
|
|
92
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
93
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
94
|
+
response = Net::HTTP.patch(url, headers, data)
|
|
95
|
+
return response unless response.code != '200'
|
|
96
|
+
|
|
97
|
+
@logger.error("Could not modify guild with Guild ID #{guild_id}. Response: #{response.body}")
|
|
98
|
+
response
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
def delete_guild(guild_id)
|
|
102
|
+
url = URI("#{@base_url}/guilds/#{guild_id}")
|
|
103
|
+
headers = { 'Authorization': @authorization_header }
|
|
104
|
+
response = Net::HTTP.delete(url, headers)
|
|
105
|
+
return response unless response.code != '204'
|
|
106
|
+
|
|
107
|
+
@logger.error("Could not delete guild with Guild ID #{guild_id}. Response: #{response.body}")
|
|
108
|
+
response
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def get_guild_channels(guild_id)
|
|
112
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/channels")
|
|
113
|
+
headers = { 'Authorization': @authorization_header }
|
|
114
|
+
response = Net::HTTP.get(url, headers)
|
|
115
|
+
return response unless response.code != '200'
|
|
116
|
+
|
|
117
|
+
@logger.error("Could not get guild channels with Guild ID #{guild_id}. Response: #{response.body}")
|
|
118
|
+
response
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
def create_guild_channel(guild_id, name, type = nil, topic = nil, bitrate = nil, user_limit = nil,
|
|
122
|
+
rate_limit_per_user = nil, position = nil, permission_overwrites = nil, parent_id = nil,
|
|
123
|
+
nsfw = nil, rtc_region = nil, video_quality_mode = nil, default_auto_archive_duration = nil,
|
|
124
|
+
default_reaction_emoji = nil, available_tags = nil, default_sort_order = nil,
|
|
125
|
+
default_forum_layout = nil, default_thread_rate_limit_per_user = nil, audit_reason = nil)
|
|
126
|
+
output = {}
|
|
127
|
+
output[:name] = name
|
|
128
|
+
output[:type] = type unless type.nil?
|
|
129
|
+
output[:topic] = topic unless topic.nil?
|
|
130
|
+
output[:bitrate] = bitrate unless bitrate.nil?
|
|
131
|
+
output[:user_limit] = user_limit unless user_limit.nil?
|
|
132
|
+
output[:rate_limit_per_user] = rate_limit_per_user unless rate_limit_per_user.nil?
|
|
133
|
+
output[:position] = position unless position.nil?
|
|
134
|
+
output[:permission_overwrites] = permission_overwrites unless permission_overwrites.nil?
|
|
135
|
+
output[:parent_id] = parent_id unless parent_id.nil?
|
|
136
|
+
output[:nsfw] = nsfw unless nsfw.nil?
|
|
137
|
+
output[:rtc_region] = rtc_region unless rtc_region.nil?
|
|
138
|
+
output[:video_quality_mode] = video_quality_mode unless video_quality_mode.nil?
|
|
139
|
+
output[:default_auto_archive_duration] = default_auto_archive_duration unless default_auto_archive_duration.nil?
|
|
140
|
+
output[:default_reaction_emoji] = default_reaction_emoji unless default_reaction_emoji.nil?
|
|
141
|
+
output[:available_tags] = available_tags unless available_tags.nil?
|
|
142
|
+
output[:default_sort_order] = default_sort_order unless default_sort_order.nil?
|
|
143
|
+
output[:default_forum_layout] = default_forum_layout unless default_forum_layout.nil?
|
|
144
|
+
unless default_thread_rate_limit_per_user.nil?
|
|
145
|
+
output[:default_thread_rate_limit_per_user] =
|
|
146
|
+
default_thread_rate_limit_per_user
|
|
147
|
+
end
|
|
148
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/channels")
|
|
149
|
+
data = JSON.generate(output)
|
|
150
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
151
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
152
|
+
response = Net::HTTP.post(url, data, headers)
|
|
153
|
+
return response unless response.code != '200'
|
|
154
|
+
|
|
155
|
+
@logger.error("Could not create guild channel in Guild ID #{guild_id}. Response: #{response.body}")
|
|
156
|
+
response
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
def modify_guild_channel_positions(guild_id, channel_id, position = nil, lock_permissions = nil, parent_id = nil)
|
|
160
|
+
output = {}
|
|
161
|
+
output[:id] = channel_id
|
|
162
|
+
output[:position] = position unless position.nil?
|
|
163
|
+
output[:lock_permissions] = lock_permissions unless lock_permissions.nil?
|
|
164
|
+
output[:parent_id] = parent_id unless parent_id.nil?
|
|
165
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/channels")
|
|
166
|
+
data = JSON.generate(output)
|
|
167
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
168
|
+
response = Net::HTTP.patch(url, headers, data)
|
|
169
|
+
return response unless response.code != '204'
|
|
170
|
+
|
|
171
|
+
@logger.error("Could not modify guild channel positions with Guild ID #{guild_id}. Response: #{response.body}")
|
|
172
|
+
response
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
def list_active_guild_threads(guild_id)
|
|
176
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/threads/active")
|
|
177
|
+
headers = { 'Authorization': @authorization_header }
|
|
178
|
+
response = Net::HTTP.get(url, headers)
|
|
179
|
+
return response unless response.code != '200'
|
|
180
|
+
|
|
181
|
+
@logger.error("Could not list active guild threads with Guild ID #{guild_id}. Response: #{response.body}")
|
|
182
|
+
response
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
def get_guild_member(guild_id, user_id)
|
|
186
|
+
url = "#{@base_url}/guilds/#{guild_id}/members/#{user_id}"
|
|
187
|
+
headers = { 'Authorization' => @authorization_header }
|
|
188
|
+
response = DiscordApi.get(url, headers)
|
|
189
|
+
return response unless response.status != 200
|
|
190
|
+
|
|
191
|
+
@logger.error("Could not get guild member with Guild ID #{guild_id} and User ID #{user_id}. Response:" \
|
|
192
|
+
"#{response.body}")
|
|
193
|
+
response
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
def list_guild_members(guild_id, limit = nil, after = nil)
|
|
197
|
+
query_string_hash = {}
|
|
198
|
+
query_string_hash[:limit] = limit
|
|
199
|
+
query_string_hash[:after] = after
|
|
200
|
+
query_string = DiscordApi.handle_query_strings(query_string_hash)
|
|
201
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/members#{query_string}")
|
|
202
|
+
headers = { 'Authorization': @authorization_header }
|
|
203
|
+
response = Net::HTTP.get(url, headers)
|
|
204
|
+
return response unless response.code != '200'
|
|
205
|
+
|
|
206
|
+
@logger.error("Could not list members with Guild ID #{guild_id}. Response: #{response.body}")
|
|
207
|
+
response
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
def search_guild_members(guild_id, query, limit = nil)
|
|
211
|
+
query_string_hash = {}
|
|
212
|
+
query_string_hash[:query] = query
|
|
213
|
+
query_string_hash[:limit] = limit
|
|
214
|
+
query_string = DiscordApi.handle_query_strings(query_string_hash)
|
|
215
|
+
url = "#{@base_url}/guilds/#{guild_id}/members/search#{query_string}"
|
|
216
|
+
headers = { 'Authorization': @authorization_header }
|
|
217
|
+
response = DiscordApi.get(url, headers)
|
|
218
|
+
return response unless response.status != 200
|
|
219
|
+
|
|
220
|
+
@logger.error("Could not search members with Guild ID #{guild_id}. Response: #{response.body}")
|
|
221
|
+
response
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
def add_guild_member(guild_id, user_id, access_token, nick = nil, roles = nil, mute = nil, deaf = nil)
|
|
225
|
+
output = {}
|
|
226
|
+
output[:access_token] = access_token
|
|
227
|
+
output[:nick] = nick unless nick.nil?
|
|
228
|
+
output[:roles] = roles unless roles.nil?
|
|
229
|
+
output[:mute] = mute unless mute.nil?
|
|
230
|
+
output[:deaf] = deaf unless deaf.nil?
|
|
231
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/members/#{user_id}")
|
|
232
|
+
data = JSON.generate(output)
|
|
233
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
234
|
+
response = Net::HTTP.put(url, data, headers)
|
|
235
|
+
if response.code == '204'
|
|
236
|
+
@logger.warn("User with ID #{user_id} is already a member of the guild with ID #{guild_id}.")
|
|
237
|
+
elsif response.code == '201'
|
|
238
|
+
@logger.info("Added user with ID #{user_id} to guild with ID #{guild_id}.")
|
|
239
|
+
else
|
|
240
|
+
@logger.error("Could not add user with ID #{user_id} to guild with ID #{guild_id}. Response: #{response.body}")
|
|
241
|
+
end
|
|
242
|
+
response
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
def modify_guild_member(guild_id, user_id, nick = nil, roles = nil, mute = nil, deaf = nil, channel_id = nil,
|
|
246
|
+
communication_disabled_until = nil, flags = nil, audit_reason = nil)
|
|
247
|
+
output = {}
|
|
248
|
+
output[:nick] = nick unless nick.nil?
|
|
249
|
+
output[:roles] = roles unless roles.nil?
|
|
250
|
+
output[:mute] = mute unless mute.nil?
|
|
251
|
+
output[:deaf] = deaf unless deaf.nil?
|
|
252
|
+
output[:channel_id] = channel_id unless channel_id.nil?
|
|
253
|
+
output[:communication_disabled_until] = communication_disabled_until
|
|
254
|
+
output[:flags] = flags unless flags.nil?
|
|
255
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/members/#{user_id}")
|
|
256
|
+
data = JSON.generate(output)
|
|
257
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
258
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
259
|
+
response = Net::HTTP.patch(url, data, headers)
|
|
260
|
+
return response unless response.code != '200'
|
|
261
|
+
|
|
262
|
+
@logger.error("Could not modify guild member with Guild ID #{guild_id} and User ID #{user_id}. " \
|
|
263
|
+
"Response: #{response.body}")
|
|
264
|
+
response
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
def modify_current_member(guild_id, nick = nil, audit_reason = nil)
|
|
268
|
+
output = {}
|
|
269
|
+
output[:nick] = nick unless nick.nil?
|
|
270
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/members/@me")
|
|
271
|
+
data = JSON.generate(output)
|
|
272
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
273
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
274
|
+
response = Net::HTTP.patch(url, data, headers)
|
|
275
|
+
return response unless response.code != '200'
|
|
276
|
+
|
|
277
|
+
@logger.error("Could not modify current member in guild with Guild ID #{guild_id}. Response: #{response.body}")
|
|
278
|
+
response
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
def modify_current_user_nick(guild_id, nick = nil, audit_reason = nil)
|
|
282
|
+
@logger.warn('The "Modify Current User Nick" endpoint has been deprecated and should not be used!')
|
|
283
|
+
output = {}
|
|
284
|
+
output[:nick] = nick unless nick.nil?
|
|
285
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/users/@me/nick")
|
|
286
|
+
data = JSON.generate(output)
|
|
287
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
288
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
289
|
+
response = Net::HTTP.patch(url, data, headers)
|
|
290
|
+
return response unless response.code != '200'
|
|
291
|
+
|
|
292
|
+
@logger.error("Could not modify current user nick in guild with ID #{guild_id}. Response: #{response.body}")
|
|
293
|
+
response
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
def add_guild_member_role(guild_id, user_id, role_id, audit_reason = nil)
|
|
297
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/members/#{user_id}/roles/#{role_id}")
|
|
298
|
+
headers = { 'Authorization': @authorization_header }
|
|
299
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
300
|
+
response = Net::HTTP.put(url, nil, headers)
|
|
301
|
+
return response unless response.code != '204'
|
|
302
|
+
|
|
303
|
+
@logger.error("Could not add role with ID #{role_id}, to user with ID #{user_id} in guild with ID #{guild_id}." \
|
|
304
|
+
" Response: #{response.body}")
|
|
305
|
+
response
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
def remove_guild_member_role(guild_id, user_id, role_id, audit_reason = nil)
|
|
309
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/members/#{user_id}/roles/#{role_id}")
|
|
310
|
+
headers = { 'Authorization': @authorization_header }
|
|
311
|
+
headers['x-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
312
|
+
response = Net::HTTP.delete(url, headers)
|
|
313
|
+
return response unless response.code != '204'
|
|
314
|
+
|
|
315
|
+
@logger.error("Could not remove role with ID #{role_id}, from user with ID #{user_id}" \
|
|
316
|
+
" in guild with ID #{guild_id}. Response: #{response.body}")
|
|
317
|
+
response
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
# For some reason when i use Net::HTTP in this function it doesn't work, but when i use Faraday it does.
|
|
321
|
+
# I should probably migrate to Faraday everywhere, but for now just a temporary fix.
|
|
322
|
+
def remove_guild_member(guild_id, user_id, audit_reason: nil)
|
|
323
|
+
url = "#{@base_url}/guilds/#{guild_id}/members/#{user_id}"
|
|
324
|
+
headers = { 'Authorization' => @authorization_header }
|
|
325
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
326
|
+
response = DiscordApi.delete(url, headers)
|
|
327
|
+
return response unless response.status != 204
|
|
328
|
+
|
|
329
|
+
@logger.error("Could not remove user with ID #{user_id} from guild with ID #{guild_id}. Response: #{response.body}")
|
|
330
|
+
response
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
def get_guild_bans(guild_id, limit = nil, before = nil, after = nil)
|
|
334
|
+
query_string_hash = {}
|
|
335
|
+
query_string_hash[:limit] = limit unless limit.nil?
|
|
336
|
+
query_string_hash[:before] = before unless before.nil?
|
|
337
|
+
query_string_hash[:after] = after unless after.nil?
|
|
338
|
+
query_string = DiscordApi.handle_query_strings(query_string_hash)
|
|
339
|
+
url = "#{@base_url}/guilds/#{guild_id}/bans#{query_string}"
|
|
340
|
+
headers = { 'Authorization' => @authorization_header }
|
|
341
|
+
response = DiscordApi.get(url, headers)
|
|
342
|
+
return response unless response.status != '200'
|
|
343
|
+
|
|
344
|
+
@logger.error("Could not get guild bans with Guild ID #{guild_id}. Response: #{response.body}")
|
|
345
|
+
response
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
def get_guild_ban(guild_id, user_id)
|
|
349
|
+
url = "#{@base_url}/guilds/#{guild_id}/bans/#{user_id}"
|
|
350
|
+
headers = { 'Authorization': @authorization_header }
|
|
351
|
+
response = DiscordApi.get(url, headers)
|
|
352
|
+
return response unless response.status != 200
|
|
353
|
+
|
|
354
|
+
if response.status == 404
|
|
355
|
+
@logger.warn("No ban found for user with ID #{user_id} in guild with ID #{guild_id}.")
|
|
356
|
+
else
|
|
357
|
+
@logger.error("Could not get guild ban for user with ID #{user_id} in guild with ID #{guild_id}." \
|
|
358
|
+
" Response: #{response.body}")
|
|
359
|
+
end
|
|
360
|
+
response
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
def create_guild_ban(guild_id, user_id, delete_message_days: nil, delete_message_seconds: nil, audit_reason: nil)
|
|
364
|
+
output = {}
|
|
365
|
+
unless delete_message_days.nil?
|
|
366
|
+
@logger.warn('The "delete_message_days" parameter has been deprecated and should not be used!')
|
|
367
|
+
output[:delete_message_days] = delete_message_days
|
|
368
|
+
end
|
|
369
|
+
output[:delete_message_seconds] = delete_message_seconds unless delete_message_seconds.nil?
|
|
370
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/bans/#{user_id}")
|
|
371
|
+
data = JSON.generate(output)
|
|
372
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
373
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
374
|
+
response = Net::HTTP.put(url, data, headers)
|
|
375
|
+
return response unless response.code != '204'
|
|
376
|
+
|
|
377
|
+
@logger.error("Could not create guild ban for user with ID #{user_id} in guild with ID #{guild_id}." \
|
|
378
|
+
" Response: #{response.body}")
|
|
379
|
+
response
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
def remove_guild_ban(guild_id, user_id, audit_reason = nil)
|
|
383
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/bans/#{user_id}")
|
|
384
|
+
headers = { 'Authorization': @authorization_header }
|
|
385
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
386
|
+
response = Net::HTTP.delete(url, headers)
|
|
387
|
+
return response unless response.code != '204'
|
|
388
|
+
|
|
389
|
+
@logger.error("Could not remove guild ban for user with ID #{user_id} in guild with ID #{guild_id}" \
|
|
390
|
+
" Response: #{response.body}")
|
|
391
|
+
response
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
def bulk_guild_ban(guild_id, user_ids, delete_message_seconds = nil, audit_reason = nil)
|
|
395
|
+
output = {}
|
|
396
|
+
output[:user_ids] = user_ids unless user_ids.nil?
|
|
397
|
+
output[:delete_message_seconds] = delete_message_seconds unless delete_message_seconds.nil?
|
|
398
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/bulk-ban")
|
|
399
|
+
data = JSON.generate(output)
|
|
400
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
401
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
402
|
+
response = Net::HTTP.post(url, data, headers)
|
|
403
|
+
return response unless response.code != '200'
|
|
404
|
+
|
|
405
|
+
if response.code == '500000'
|
|
406
|
+
@logger.error("No users were banned in bulk ban in guild with ID #{guild_id}. Response: #{response.body}")
|
|
407
|
+
else
|
|
408
|
+
@logger.error("Could not bulk ban users in guild with ID #{guild_id}. Response: #{response.body}")
|
|
409
|
+
end
|
|
410
|
+
response
|
|
411
|
+
end
|
|
412
|
+
|
|
413
|
+
def get_guild_roles(guild_id)
|
|
414
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/roles")
|
|
415
|
+
headers = { 'Authorization': @authorization_header }
|
|
416
|
+
response = Net::HTTP.get(url, headers)
|
|
417
|
+
return response unless response.code != '200'
|
|
418
|
+
|
|
419
|
+
@logger.error("Could not get guild roles with Guild ID #{guild_id}. Response: #{response.body}")
|
|
420
|
+
response
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
def get_guild_role(guild_id, role_id)
|
|
424
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/roles/#{role_id}")
|
|
425
|
+
headers = { 'Authorization': @authorization_header }
|
|
426
|
+
response = Net::HTTP.get(url, headers)
|
|
427
|
+
return response unless response.code != '200'
|
|
428
|
+
|
|
429
|
+
@logger.error("Could not get role with ID #{role_id} in guild with ID #{guild_id}. Response: #{response.body}")
|
|
430
|
+
response
|
|
431
|
+
end
|
|
432
|
+
|
|
433
|
+
def create_guild_role(guild_id, name = nil, permissions = nil, color = nil, hoist = nil, icon = nil,
|
|
434
|
+
unicode_emoji = nil, mentionable = nil, audit_reason = nil)
|
|
435
|
+
output = {}
|
|
436
|
+
output[:name] = name unless name.nil?
|
|
437
|
+
output[:permissions] = permissions unless permissions.nil?
|
|
438
|
+
output[:color] = color unless color.nil?
|
|
439
|
+
output[:hoist] = hoist unless hoist.nil?
|
|
440
|
+
output[:icon] = icon unless icon.nil?
|
|
441
|
+
output[:unicode_emoji] = unicode_emoji unless unicode_emoji.nil?
|
|
442
|
+
output[:mentionable] = mentionable unless mentionable.nil?
|
|
443
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/roles")
|
|
444
|
+
data = JSON.generate(output)
|
|
445
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
446
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
447
|
+
response = Net::HTTP.post(url, data, headers)
|
|
448
|
+
return response unless response.code != '200'
|
|
449
|
+
|
|
450
|
+
@logger.error("Could not create guild role in guild with ID #{guild_id}. Response: #{response.body}")
|
|
451
|
+
response
|
|
452
|
+
end
|
|
453
|
+
|
|
454
|
+
def modify_guild_role_positions(guild_id, id, position = nil, audit_reason = nil)
|
|
455
|
+
output = {}
|
|
456
|
+
output[:id] = id
|
|
457
|
+
output[:position] = position unless position.nil?
|
|
458
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/roles")
|
|
459
|
+
data = JSON.generate(output)
|
|
460
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
461
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
462
|
+
response = Net::HTTP.patch(url, data, headers)
|
|
463
|
+
return response unless response.code != '200'
|
|
464
|
+
|
|
465
|
+
@logger.error("Could not modify guild role positions in guild with ID #{guild_id}. Response: #{response.body}")
|
|
466
|
+
response
|
|
467
|
+
end
|
|
468
|
+
|
|
469
|
+
def modify_guild_role(guild_id, role_id, name = nil, permissions = nil, color = nil, hoist = nil, icon = nil,
|
|
470
|
+
unicode_emoji = nil, mentionable = nil, audit_reason = nil)
|
|
471
|
+
output = {}
|
|
472
|
+
output[:name] = name unless name.nil?
|
|
473
|
+
output[:permissions] = permissions unless permissions.nil?
|
|
474
|
+
output[:color] = color unless color.nil?
|
|
475
|
+
output[:hoist] = hoist unless hoist.nil?
|
|
476
|
+
output[:icon] = icon unless icon.nil?
|
|
477
|
+
output[:unicode_emoji] = unicode_emoji unless unicode_emoji.nil?
|
|
478
|
+
output[:mentionable] = mentionable unless mentionable.nil?
|
|
479
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/roles/#{role_id}")
|
|
480
|
+
data = JSON.generate(output)
|
|
481
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
482
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
483
|
+
response = Net::HTTP.patch(url, data, headers)
|
|
484
|
+
return response unless response.code != '200'
|
|
485
|
+
|
|
486
|
+
@logger.error("Could not modify guild role with ID #{role_id} in guild with ID #{guild_id}." \
|
|
487
|
+
" Response: #{response.body}")
|
|
488
|
+
response
|
|
489
|
+
end
|
|
490
|
+
|
|
491
|
+
def modify_guild_mfa_level(guild_id, level, audit_reason = nil)
|
|
492
|
+
output = {}
|
|
493
|
+
output[:level] = level unless level.nil?
|
|
494
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/mfa")
|
|
495
|
+
data = JSON.generate(output)
|
|
496
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
497
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
498
|
+
response = Net::HTTP.post(url, data, headers)
|
|
499
|
+
return unless response != JSON.generate({ level: level }) # might not be the correct way to check for success
|
|
500
|
+
|
|
501
|
+
@logger.error("Failed to modify guild MFA level. Response: #{response.body}")
|
|
502
|
+
response
|
|
503
|
+
end
|
|
504
|
+
|
|
505
|
+
def delete_guild_role(guild_id, role_id, audit_reason = nil)
|
|
506
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/roles/#{role_id}")
|
|
507
|
+
headers = { 'Authorization': @authorization_header }
|
|
508
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
509
|
+
response = Net::HTTP.delete(url, headers)
|
|
510
|
+
return response unless response.code != '204'
|
|
511
|
+
|
|
512
|
+
@logger.error("Failed to delete guild role. Response: #{response.body}")
|
|
513
|
+
response
|
|
514
|
+
end
|
|
515
|
+
|
|
516
|
+
def get_guild_prune_count(guild_id, days = nil, include_roles = nil)
|
|
517
|
+
query_string_hash = {}
|
|
518
|
+
query_string_hash[:days] = days unless days.nil?
|
|
519
|
+
query_string_hash[:include_roles] = include_roles unless include_roles.nil?
|
|
520
|
+
query_string = DiscordApi.handle_query_strings(query_string_hash)
|
|
521
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/prune#{query_string}")
|
|
522
|
+
headers = { 'Authorization': @authorization_header }
|
|
523
|
+
response = Net::HTTP.get(url, headers)
|
|
524
|
+
return response unless response.code != '200'
|
|
525
|
+
|
|
526
|
+
@logger.error("Failed to get guild prune count. Response: #{response.body}")
|
|
527
|
+
response
|
|
528
|
+
end
|
|
529
|
+
|
|
530
|
+
def begin_guild_prune(guild_id, days = 7, include_roles = 'none', reason = nil, audit_reason = nil,
|
|
531
|
+
compute_prune_count: true)
|
|
532
|
+
output = {}
|
|
533
|
+
output[:days] = days unless days.nil?
|
|
534
|
+
output[:compute_prune_count] = compute_prune_count unless compute_prune_count.nil?
|
|
535
|
+
output[:include_roles] = include_roles unless include_roles.nil?
|
|
536
|
+
unless reason.nil?
|
|
537
|
+
@logger.warn('The "reason" parameter has been deprecated and should not be used!')
|
|
538
|
+
output[:reason] = reason
|
|
539
|
+
end
|
|
540
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/prune")
|
|
541
|
+
data = JSON.generate(output)
|
|
542
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
543
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
544
|
+
response = Net::HTTP.post(url, data, headers)
|
|
545
|
+
return response unless response.code != '200'
|
|
546
|
+
|
|
547
|
+
@logger.error("Failed to begin guild prune. Response: #{response.body}")
|
|
548
|
+
response
|
|
549
|
+
end
|
|
550
|
+
|
|
551
|
+
def get_guild_voice_regions(guild_id)
|
|
552
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/regions")
|
|
553
|
+
headers = { 'Authorization': @authorization_header }
|
|
554
|
+
response = Net::HTTP.get(url, headers)
|
|
555
|
+
return response unless response.code != '200'
|
|
556
|
+
|
|
557
|
+
@logger.error("Failed to get guild voice regions. Response: #{response.body}")
|
|
558
|
+
response
|
|
559
|
+
end
|
|
560
|
+
|
|
561
|
+
def get_guild_invites(guild_id)
|
|
562
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/invites")
|
|
563
|
+
headers = { 'Authorization': @authorization_header }
|
|
564
|
+
response = Net::HTTP.get(url, headers)
|
|
565
|
+
return response unless response.code != '200'
|
|
566
|
+
|
|
567
|
+
@logger.error("Failed to get guild invites. Response: #{response.body}")
|
|
568
|
+
response
|
|
569
|
+
end
|
|
570
|
+
|
|
571
|
+
def get_guild_integrations(guild_id)
|
|
572
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/integrations")
|
|
573
|
+
headers = { 'Authorization': @authorization_header }
|
|
574
|
+
response = Net::HTTP.get(url, headers)
|
|
575
|
+
unless response.code != '200'
|
|
576
|
+
if JSON.parse(response.body).length == 50
|
|
577
|
+
@logger.warn('The endpoint returned 50 integrations, which means there could be more integrations not shown.')
|
|
578
|
+
end
|
|
579
|
+
response
|
|
580
|
+
end
|
|
581
|
+
|
|
582
|
+
@logger.error("Failed to get guild integrations. Response: #{response.body}")
|
|
583
|
+
response
|
|
584
|
+
end
|
|
585
|
+
|
|
586
|
+
def delete_guild_integration(guild_id, integration_id, audit_reason = nil)
|
|
587
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/integrations/#{integration_id}")
|
|
588
|
+
headers = { 'Authorization': @authorization_header }
|
|
589
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
590
|
+
response = Net::HTTP.delete(url, headers)
|
|
591
|
+
return response unless response.code != '204'
|
|
592
|
+
|
|
593
|
+
@logger.error("Failed to delete guild integration. Response: #{response.body}")
|
|
594
|
+
response
|
|
595
|
+
end
|
|
596
|
+
|
|
597
|
+
def get_guild_widget_settings(guild_id)
|
|
598
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/widget")
|
|
599
|
+
headers = { 'Authorization': @authorization_header }
|
|
600
|
+
response = Net::HTTP.get(url, headers)
|
|
601
|
+
return response unless response.code != '200'
|
|
602
|
+
|
|
603
|
+
@logger.error("Failed to get guild widget settings. Response: #{response.body}")
|
|
604
|
+
response
|
|
605
|
+
end
|
|
606
|
+
|
|
607
|
+
def modify_guild_widget(guild_id, enabled, channel_id = nil, audit_reason = nil)
|
|
608
|
+
output = {}
|
|
609
|
+
output[:enabled] = enabled
|
|
610
|
+
output[:channel_id] = channel_id unless channel_id.nil?
|
|
611
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/widget")
|
|
612
|
+
data = JSON.generate(output)
|
|
613
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
614
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
615
|
+
response = Net::HTTP.patch(url, data, headers)
|
|
616
|
+
return response unless response.code != '200'
|
|
617
|
+
|
|
618
|
+
@logger.error("Failed to modify guild widget. Response: #{response.body}")
|
|
619
|
+
response
|
|
620
|
+
end
|
|
621
|
+
|
|
622
|
+
def get_guild_wiget(guild_id)
|
|
623
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/widget.json")
|
|
624
|
+
headers = { 'Authorization': @authorization_header }
|
|
625
|
+
response = Net::HTTP.get(url, headers)
|
|
626
|
+
return response unless response.code != '200'
|
|
627
|
+
|
|
628
|
+
@logger.error("Failed to get guild widget. Response: #{response.body}")
|
|
629
|
+
response
|
|
630
|
+
end
|
|
631
|
+
|
|
632
|
+
def get_guild_vanity_url(guild_id)
|
|
633
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/vanity-url")
|
|
634
|
+
headers = { 'Authorization': @authorization_header }
|
|
635
|
+
response = Net::HTTP.get(url, headers)
|
|
636
|
+
return response unless response.code != '200'
|
|
637
|
+
|
|
638
|
+
@logger.error('Failed to get guild vanity URL, perhaps you do not have the MANAGE_GUILD permission. ' \
|
|
639
|
+
"If you only want to get the Vanity URL, use the get_guild endpoint. Response: #{response.body}")
|
|
640
|
+
response
|
|
641
|
+
end
|
|
642
|
+
|
|
643
|
+
def get_guild_widget_image(guild_id, shield: false, banner1: false, banner2: false, banner3: false, banner4: false)
|
|
644
|
+
options = { shield: shield, banner1: banner1, banner2: banner2, banner3: banner3, banner4: banner4 }
|
|
645
|
+
true_keys = options.select { |_k, v| v }.keys
|
|
646
|
+
|
|
647
|
+
if true_keys.size > 1
|
|
648
|
+
@logger.error('You can only specify one of shield, banner1, banner2, banner3, or banner4 as true.')
|
|
649
|
+
nil
|
|
650
|
+
elsif true_keys.size == 1
|
|
651
|
+
style = true_keys.first.to_s
|
|
652
|
+
end
|
|
653
|
+
|
|
654
|
+
query_string_hash = {}
|
|
655
|
+
query_string_hash[:style] = style unless style.nil?
|
|
656
|
+
query_string = DiscordApi.handle_query_strings(query_string_hash)
|
|
657
|
+
|
|
658
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/widget.png#{query_string}")
|
|
659
|
+
response = Net::HTTP.get(url)
|
|
660
|
+
return unless response.code != '200'
|
|
661
|
+
|
|
662
|
+
@logger.error("Failed to get guild widget image. Response: #{response.body}")
|
|
663
|
+
response
|
|
664
|
+
end
|
|
665
|
+
|
|
666
|
+
def get_guild_welcome_screen(guild_id)
|
|
667
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/welcome-screen")
|
|
668
|
+
headers = { 'Authorization': @authorization_header }
|
|
669
|
+
response = Net::HTTP.get(url, headers)
|
|
670
|
+
return response unless response.code != '200'
|
|
671
|
+
|
|
672
|
+
@logger.error("Failed to get guild welcome screen. Response: #{response.body}")
|
|
673
|
+
response
|
|
674
|
+
end
|
|
675
|
+
|
|
676
|
+
def modify_guild_welcome_screen(guild_id, enabled = nil, welcome_channels = nil, description = nil,
|
|
677
|
+
audit_reason = nil)
|
|
678
|
+
output = {}
|
|
679
|
+
output[:enabled] = enabled unless enabled.nil?
|
|
680
|
+
output[:welcome_channels] = welcome_channels unless welcome_channels.nil?
|
|
681
|
+
output[:description] = description unless description.nil?
|
|
682
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/welcome-screen")
|
|
683
|
+
data = JSON.generate(output)
|
|
684
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
685
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
686
|
+
response = Net::HTTP.patch(url, data, headers)
|
|
687
|
+
return response unless response.code != '200'
|
|
688
|
+
|
|
689
|
+
@logger.error("Failed to modify guild welcome screen. Response: #{response.body}")
|
|
690
|
+
response
|
|
691
|
+
end
|
|
692
|
+
|
|
693
|
+
def get_guild_onboarding(guild_id)
|
|
694
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/onboarding")
|
|
695
|
+
headers = { 'Authorization': @authorization_header }
|
|
696
|
+
response = Net::HTTP.get(url, headers)
|
|
697
|
+
return response unless response.code != '200'
|
|
698
|
+
|
|
699
|
+
@logger.error("Failed to get guild onboarding. Response: #{response.body}")
|
|
700
|
+
response
|
|
701
|
+
end
|
|
702
|
+
|
|
703
|
+
def modify_guild_onboarding(guild_id, prompts, default_channel_ids, enabled, mode, audit_reason = nil)
|
|
704
|
+
output = {}
|
|
705
|
+
output[:prompts] = prompts
|
|
706
|
+
output[:default_channel_ids] = default_channel_ids
|
|
707
|
+
output[:enabled] = enabled
|
|
708
|
+
output[:mode] = mode
|
|
709
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/onboarding")
|
|
710
|
+
data = JSON.generate(output)
|
|
711
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
712
|
+
headers['X-Audit-Log-Reason'] = audit_reason unless audit_reason.nil?
|
|
713
|
+
response = Net::HTTP.put(url, data, headers)
|
|
714
|
+
return response unless response.code != '200'
|
|
715
|
+
|
|
716
|
+
@logger.error("Failed to modify guild onboarding. Response: #{response.body}")
|
|
717
|
+
response
|
|
718
|
+
end
|
|
719
|
+
|
|
720
|
+
def modify_guild_incident_actions(guild_id, invites_disabled_until = nil, dms_disabled_until = nil)
|
|
721
|
+
output = {}
|
|
722
|
+
# if only discord wouldn't of have required to set a variable to null for some functionality
|
|
723
|
+
if invites_disabled_until == false
|
|
724
|
+
output[:invites_disabled_until] = nil
|
|
725
|
+
elsif !invites_disabled_until.nil? && invites_disabled_until != false
|
|
726
|
+
output[:invites_disabled_until] = invites_disabled_until
|
|
727
|
+
end
|
|
728
|
+
if dms_disabled_until == false
|
|
729
|
+
output[:dms_disabled_until] = nil
|
|
730
|
+
elsif !dms_disabled_until.nil? && dms_disabled_until != false
|
|
731
|
+
output[:dms_disabled_until] = dms_disabled_until
|
|
732
|
+
end
|
|
733
|
+
url = URI("#{@base_url}/guilds/#{guild_id}/incident-actions")
|
|
734
|
+
data = JSON.generate(output)
|
|
735
|
+
headers = { 'Authorization': @authorization_header, 'Content-Type': 'application/json' }
|
|
736
|
+
response = Net::HTTP.put(url, data, headers)
|
|
737
|
+
# same problem with as above
|
|
738
|
+
return response unless response.code != '200'
|
|
739
|
+
|
|
740
|
+
@logger.error("Failed to modify guild incident actions. Response: #{response.body}")
|
|
741
|
+
response
|
|
742
|
+
end
|
|
743
|
+
end
|