Skip to content

Commit a51283c

Browse files
committed
We ball
1 parent 24d984c commit a51283c

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

lib/discordrb/api/application.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,13 @@ def delete_application_emoji(token, application_id, emoji_id)
278278

279279
# Edit the current application for the requesting bot user.
280280
# https://discord.com/developers/docs/resources/application#edit-current-application
281-
def update_current_application(token, custom_install_url = :undef, description = :undef, role_connections_verification_url = :undef, install_params = :undef, integration_types_config = :undef, flags = :undef, interactions_endpoint_url = :undef, tags = :undef, event_webhooks_url = :undef, event_webhooks_status = :undef, event_webhooks_types = :undef, icon = :undef, cover_image = :undef)
281+
def update_current_application(token, custom_install_url: :undef, description: :undef, role_connections_verification_url: :undef, install_params: :undef, integration_types_config: :undef, flags: :undef, interactions_endpoint_url: :undef, tags: :undef, event_webhooks_url: :undef, event_webhooks_status: :undef, event_webhooks_types: :undef, icon: :undef, cover_image: :undef)
282282
Discordrb::API.request(
283283
:applications_me,
284284
nil,
285285
:patch,
286286
"#{Discordrb::API.api_base}/applications/@me",
287-
{ custom_install_url: custom_install_url, description: description, role_connections_verification_url: role_connections_verification_url, install_params: install_params, integration_types_config: integration_types_config, flags: flags, interactions_endpoint_url: interactions_endpoint_url, tags: tags, event_webhooks_url: event_webhooks_url, event_webhooks_status: event_webhooks_status, event_webhooks_types: event_webhooks_types, icon: icon, cover_image: cover_image }.reject { |_, v| v == :undef }.to_json,
287+
{ custom_install_url: custom_install_url, description: description, role_connections_verification_url: role_connections_verification_url, install_params: install_params, integration_types_config: integration_types_config, flags: flags, interactions_endpoint_url: interactions_endpoint_url, tags: tags, event_webhooks_url: event_webhooks_url, event_webhooks_status: event_webhooks_status, event_webhooks_types: event_webhooks_types, icon: icon, cover_image: cover_image }.reject { |_, value| value == :undef }.to_json,
288288
Authorization: token,
289289
content_type: :json
290290
)

lib/discordrb/data/application.rb

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -342,20 +342,7 @@ def collect_integration_types
342342

343343
# @!visibility private
344344
def update_application(new_data)
345-
update_data(JSON.parse(API::Application.update_current_application(@bot.token,
346-
new_data[:custom_install_url] || :undef,
347-
new_data[:description] || :undef,
348-
new_data[:role_connections_verification_url] || :undef,
349-
new_data[:install_params] || :undef,
350-
new_data[:integration_types_config] || :undef,
351-
new_data[:flags] || :undef,
352-
new_data[:interactions_endpoint_url] || :undef,
353-
new_data[:tags] || :undef,
354-
new_data[:event_webhooks_url] || :undef,
355-
new_data[:event_webhooks_status] || :undef,
356-
new_data[:event_webhooks_types] || :undef,
357-
new_data.key?(:icon) ? new_data[:icon] : :undef,
358-
new_data.key?(:cover_image) ? new_data[:cover_image] : :undef)))
345+
update_data(JSON.parse(API::Application.update_current_application(@bot.token, **new_data)))
359346
end
360347
end
361348
end

0 commit comments

Comments
 (0)