Class: LibDiscord::Client
- Inherits:
-
Object
- Object
- LibDiscord::Client
- Defined in:
- lib/lib_discord/client.rb
Overview
You will mainly be interacting with instances of this class when using lib_discord to access Discord’s web API. Initialize a client and cache it for as long as you need to make requests to Discord using a given authorization header.
require "lib_discord"
client = LibDiscord::Client.new("Bot my.amazing.token")
Instance Method Summary collapse
- #add_guild_member(guild_id, user_id, body, reason: nil) ⇒ Response
- #add_guild_member_role(guild_id, user_id, role_id, reason: nil) ⇒ Response
- #add_member_to_lobby(lobby_id, user_id, body, reason: nil) ⇒ Response
- #add_thread_member(channel_id, user_id, reason: nil) ⇒ Response
-
#batch_edit_application_command_permissions(application_id, guild_id, body, reason: nil) ⇒ Response
deprecated
Deprecated.
This endpoint has been disabled with updates to command permissions (Permissions v2). Instead, you can edit each application command permissions (though you should be careful to handle any potential rate limits).
- #begin_guild_prune(guild_id, body, reason: nil) ⇒ Response
- #bulk_delete_messages(channel_id, body, reason: nil) ⇒ Response
- #bulk_guild_ban(guild_id, body, reason: nil) ⇒ Response
- #bulk_overwrite_global_application_commands(application_id, body, reason: nil) ⇒ Response
- #bulk_overwrite_guild_application_commands(application_id, guild_id, body, reason: nil) ⇒ Response
- #consume_entitlement(application_id, entitlement_id, reason: nil) ⇒ Response
- #create_application_emoji(application_id, body, reason: nil) ⇒ Response
- #create_auto_moderation_rule(guild_id, body, reason: nil) ⇒ Response
- #create_channel_invite(channel_id, body, reason: nil) ⇒ Response
- #create_dm(body, reason: nil) ⇒ Response
- #create_followup_message(application_id, interaction_token, body, reason: nil) ⇒ Response
- #create_global_application_command(application_id, body, reason: nil) ⇒ Response
- #create_group_dm(body, reason: nil) ⇒ Response
- #create_guild(body, reason: nil) ⇒ Response
- #create_guild_application_command(application_id, guild_id, body, reason: nil) ⇒ Response
- #create_guild_ban(guild_id, user_id, body, reason: nil) ⇒ Response
- #create_guild_channel(guild_id, body, reason: nil) ⇒ Response
- #create_guild_emoji(guild_id, body, reason: nil) ⇒ Response
- #create_guild_from_guild_template(template_code, body, reason: nil) ⇒ Response
- #create_guild_role(guild_id, body, reason: nil) ⇒ Response
- #create_guild_scheduled_event(guild_id, body, reason: nil) ⇒ Response
- #create_guild_soundboard_sound(guild_id, body, reason: nil) ⇒ Response
- #create_guild_sticker(guild_id, body, reason: nil) ⇒ Response
- #create_guild_template(guild_id, body, reason: nil) ⇒ Response
- #create_interaction_response(interaction_id, interaction_token, body, reason: nil) ⇒ Response
- #create_lobby(body, reason: nil) ⇒ Response
- #create_message(channel_id, body, reason: nil) ⇒ Response
- #create_reaction(channel_id, message_id, emoji, reason: nil) ⇒ Response
- #create_stage_instance(body, reason: nil) ⇒ Response
- #create_test_entitlement(application_id, body, reason: nil) ⇒ Response
- #create_webhook(channel_id, body, reason: nil) ⇒ Response
- #crosspost_message(channel_id, message_id, reason: nil) ⇒ Response
- #delete_all_reactions(channel_id, message_id, reason: nil) ⇒ Response
- #delete_all_reactions_for_emoji(channel_id, message_id, emoji, reason: nil) ⇒ Response
- #delete_application_emoji(application_id, emoji_id, reason: nil) ⇒ Response
- #delete_auto_moderation_rule(guild_id, auto_moderation_rule_id, reason: nil) ⇒ Response
- #delete_channel(channel_id, reason: nil) ⇒ Response (also: #close_channel)
- #delete_channel_permission(channel_id, overwrite_id, reason: nil) ⇒ Response
- #delete_followup_message(application_id, interaction_token, message_id, reason: nil) ⇒ Response
- #delete_global_application_command(application_id, command_id, reason: nil) ⇒ Response
- #delete_guild(guild_id, reason: nil) ⇒ Response
- #delete_guild_application_command(application_id, guild_id, command_id, reason: nil) ⇒ Response
- #delete_guild_emoji(guild_id, emoji_id, reason: nil) ⇒ Response
- #delete_guild_integration(guild_id, integration_id, reason: nil) ⇒ Response
- #delete_guild_role(guild_id, role_id, reason: nil) ⇒ Response
- #delete_guild_scheduled_event(guild_id, guild_scheduled_event_id, reason: nil) ⇒ Response
- #delete_guild_soundboard_sound(guild_id, sound_id, reason: nil) ⇒ Response
- #delete_guild_sticker(guild_id, sticker_id, reason: nil) ⇒ Response
- #delete_guild_template(guild_id, template_code, reason: nil) ⇒ Response
- #delete_invite(invite_code, reason: nil) ⇒ Response
- #delete_lobby(lobby_id, reason: nil) ⇒ Response
- #delete_message(channel_id, message_id, reason: nil) ⇒ Response
- #delete_original_interaction_response(application_id, interaction_token, reason: nil) ⇒ Response
- #delete_own_reaction(channel_id, message_id, emoji, reason: nil) ⇒ Response
- #delete_stage_instance(channel_id, reason: nil) ⇒ Response
- #delete_test_entitlement(application_id, entitlement_id, reason: nil) ⇒ Response
- #delete_user_reaction(channel_id, message_id, emoji, user_id, reason: nil) ⇒ Response
- #delete_webhook(webhook_id, reason: nil) ⇒ Response
- #delete_webhook_message(webhook_id, webhook_token, message_id, reason: nil) ⇒ Response
- #delete_webhook_with_token(webhook_id, webhook_token, reason: nil) ⇒ Response
- #edit_application_command_permissions(application_id, guild_id, command_id, body, reason: nil) ⇒ Response
- #edit_channel_permissions(channel_id, overwrite_id, body, reason: nil) ⇒ Response
- #edit_current_application(body, reason: nil) ⇒ Response
- #edit_followup_message(application_id, interaction_token, message_id, body, reason: nil) ⇒ Response
- #edit_global_application_command(application_id, command_id, body, reason: nil) ⇒ Response
- #edit_guild_application_command(application_id, guild_id, command_id, body, reason: nil) ⇒ Response
- #edit_message(channel_id, message_id, body, reason: nil) ⇒ Response
- #edit_original_interaction_response(application_id, interaction_token, body, reason: nil) ⇒ Response
- #edit_webhook_message(webhook_id, webhook_token, message_id, body, query = {}, reason: nil) ⇒ Response
- #end_poll(channel_id, message_id, reason: nil) ⇒ Response
- #execute_github_compatible_webhook(webhook_id, webhook_token, query = {}, reason: nil) ⇒ Response
- #execute_slack_compatible_webhook(webhook_id, webhook_token, query = {}, reason: nil) ⇒ Response
- #execute_webhook(webhook_id, webhook_token, body, query = {}, reason: nil) ⇒ Response
- #follow_announcement_channel(channel_id, body, reason: nil) ⇒ Response
- #get_answer_voters(channel_id, message_id, answer_id, query = {}, reason: nil) ⇒ Response
- #get_application_activity_instance(application_id, instance_id, reason: nil) ⇒ Response
- #get_application_command_permissions(application_id, guild_id, command_id, reason: nil) ⇒ Response
- #get_application_emoji(application_id, emoji_id, reason: nil) ⇒ Response
- #get_application_role_connection_metadata_records(application_id, reason: nil) ⇒ Response
-
#get_authorize_url(query = {}) ⇒ URI
Get the URL for starting the OAuth2 Authorization flow.
- #get_auto_moderation_rule(guild_id, auto_moderation_rule_id, reason: nil) ⇒ Response
- #get_channel(channel_id, reason: nil) ⇒ Response
- #get_channel_invites(channel_id, reason: nil) ⇒ Response
- #get_channel_message(channel_id, message_id, reason: nil) ⇒ Response
- #get_channel_messages(channel_id, query = {}, reason: nil) ⇒ Response
- #get_channel_webhooks(channel_id, reason: nil) ⇒ Response
- #get_current_application(reason: nil) ⇒ Response
- #get_current_user(reason: nil) ⇒ Response
- #get_current_user_application_role_connection(application_id, reason: nil) ⇒ Response
- #get_current_user_connections(reason: nil) ⇒ Response
- #get_current_user_guild_member(guild_id, reason: nil) ⇒ Response
- #get_current_user_guilds(query = {}, reason: nil) ⇒ Response
- #get_current_user_voice_state(guild_id, reason: nil) ⇒ Response
- #get_entitlement(application_id, entitlement_id, reason: nil) ⇒ Response
- #get_followup_message(application_id, interaction_token, message_id, reason: nil) ⇒ Response
- #get_gateway(reason: nil) ⇒ Response
- #get_gateway_bot(reason: nil) ⇒ Response
- #get_global_application_command(application_id, command_id, reason: nil) ⇒ Response
- #get_global_application_commands(application_id, query = {}, reason: nil) ⇒ Response
- #get_guild(guild_id, query = {}, reason: nil) ⇒ Response
- #get_guild_application_command(application_id, guild_id, command_id, reason: nil) ⇒ Response
- #get_guild_application_command_permissions(application_id, guild_id, reason: nil) ⇒ Response
- #get_guild_application_commands(application_id, guild_id, query = {}, reason: nil) ⇒ Response
- #get_guild_audit_log(guild_id, query = {}, reason: nil) ⇒ Response
- #get_guild_ban(guild_id, user_id, reason: nil) ⇒ Response
- #get_guild_bans(guild_id, query = {}, reason: nil) ⇒ Response
- #get_guild_channels(guild_id, reason: nil) ⇒ Response
- #get_guild_emoji(guild_id, emoji_id, reason: nil) ⇒ Response
- #get_guild_integrations(guild_id, reason: nil) ⇒ Response
- #get_guild_invites(guild_id, reason: nil) ⇒ Response
- #get_guild_member(guild_id, user_id, reason: nil) ⇒ Response
- #get_guild_onboarding(guild_id, reason: nil) ⇒ Response
- #get_guild_preview(guild_id, reason: nil) ⇒ Response
- #get_guild_prune_count(guild_id, query = {}, reason: nil) ⇒ Response
- #get_guild_role(guild_id, role_id, reason: nil) ⇒ Response
- #get_guild_roles(guild_id, reason: nil) ⇒ Response
- #get_guild_scheduled_event(guild_id, guild_scheduled_event_id, query = {}, reason: nil) ⇒ Response
- #get_guild_scheduled_event_users(guild_id, guild_scheduled_event_id, query = {}, reason: nil) ⇒ Response
- #get_guild_soundboard_sound(guild_id, sound_id, reason: nil) ⇒ Response
- #get_guild_sticker(guild_id, sticker_id, reason: nil) ⇒ Response
- #get_guild_template(template_code, reason: nil) ⇒ Response
- #get_guild_templates(guild_id, reason: nil) ⇒ Response
- #get_guild_vanity_url(guild_id, reason: nil) ⇒ Response
- #get_guild_voice_regions(guild_id, reason: nil) ⇒ Response
- #get_guild_webhooks(guild_id, reason: nil) ⇒ Response
- #get_guild_welcome_screen(guild_id, reason: nil) ⇒ Response
- #get_guild_widget(guild_id, reason: nil) ⇒ Response
- #get_guild_widget_image(guild_id, query = {}, reason: nil) ⇒ Response
- #get_guild_widget_settings(guild_id, reason: nil) ⇒ Response
-
#get_install_url(query = {}) ⇒ URI
Get the URL for installing an application.
- #get_invite(invite_code, query = {}, reason: nil) ⇒ Response
- #get_lobby(lobby_id, reason: nil) ⇒ Response
- #get_original_interaction_response(application_id, interaction_token, reason: nil) ⇒ Response
- #get_pinned_messages(channel_id, reason: nil) ⇒ Response
- #get_reactions(channel_id, message_id, emoji, query = {}, reason: nil) ⇒ Response
- #get_sku_subscription(sku_id, subscription_id, reason: nil) ⇒ Response
- #get_stage_instance(channel_id, reason: nil) ⇒ Response
- #get_sticker(sticker_id, reason: nil) ⇒ Response
- #get_sticker_pack(pack_id, reason: nil) ⇒ Response
- #get_thread_member(channel_id, user_id, query = {}, reason: nil) ⇒ Response
- #get_user(user_id, reason: nil) ⇒ Response
- #get_user_voice_state(guild_id, user_id, reason: nil) ⇒ Response
- #get_webhook(webhook_id, reason: nil) ⇒ Response
- #get_webhook_message(webhook_id, webhook_token, message_id, query = {}, reason: nil) ⇒ Response
- #get_webhook_with_token(webhook_id, webhook_token, reason: nil) ⇒ Response
- #group_dm_add_recipient(channel_id, user_id, body, reason: nil) ⇒ Response
- #group_dm_remove_recipient(channel_id, user_id, reason: nil) ⇒ Response
- #initialize(auth = nil, user_agent: "LibDiscord (#{LibDiscord::PROJECT_URL}, #{LibDiscord.version})", logger: nil) ⇒ self constructor
- #join_thread(channel_id, reason: nil) ⇒ Response
- #leave_guild(guild_id, reason: nil) ⇒ Response
- #leave_lobby(lobby_id, reason: nil) ⇒ Response
- #leave_thread(channel_id, reason: nil) ⇒ Response
- #link_channel_to_lobby(lobby_id, body, reason: nil) ⇒ Response
- #list_active_guild_threads(guild_id, reason: nil) ⇒ Response
- #list_application_emojis(application_id, reason: nil) ⇒ Response
- #list_auto_moderation_rules_for_guild(guild_id, reason: nil) ⇒ Response
- #list_default_soundboard_sounds(reason: nil) ⇒ Response
- #list_entitlements(application_id, reason: nil) ⇒ Response
- #list_guild_emojis(guild_id, reason: nil) ⇒ Response
- #list_guild_members(guild_id, query = {}, reason: nil) ⇒ Response
- #list_guild_soundboard_sounds(guild_id, reason: nil) ⇒ Response
- #list_guild_stickers(guild_id, reason: nil) ⇒ Response
- #list_joined_private_archived_threads(channel_id, query = {}, reason: nil) ⇒ Response
- #list_private_archived_threads(channel_id, query = {}, reason: nil) ⇒ Response
- #list_public_archived_threads(channel_id, query = {}, reason: nil) ⇒ Response
- #list_scheduled_events_for_guild(guild_id, query = {}, reason: nil) ⇒ Response
- #list_sku_subscriptions(sku_id, query = {}, reason: nil) ⇒ Response
- #list_skus(application_id, reason: nil) ⇒ Response
- #list_sticker_packs(reason: nil) ⇒ Response
- #list_thread_members(channel_id, query = {}, reason: nil) ⇒ Response
- #list_voice_regions(reason: nil) ⇒ Response
- #modify_application_emoji(application_id, emoji_id, body, reason: nil) ⇒ Response
- #modify_auto_moderation_rule(guild_id, auto_moderation_rule_id, body, reason: nil) ⇒ Response
- #modify_channel(channel_id, body, reason: nil) ⇒ Response
- #modify_current_member(guild_id, body, reason: nil) ⇒ Response
- #modify_current_user(body, reason: nil) ⇒ Response
-
#modify_current_user_nick(guild_id, body, reason: nil) ⇒ Response
deprecated
Deprecated.
Use #modify_current_member instead.
- #modify_current_user_voice_state(guild_id, body, reason: nil) ⇒ Response
- #modify_guild(guild_id, body, reason: nil) ⇒ Response
- #modify_guild_channel_positions(guild_id, body, reason: nil) ⇒ Response
- #modify_guild_emoji(guild_id, emoji_id, body, reason: nil) ⇒ Response
- #modify_guild_incident_actions(guild_id, body, reason: nil) ⇒ Response
- #modify_guild_member(guild_id, user_id, body, reason: nil) ⇒ Response
- #modify_guild_mfa_level(guild_id, body, reason: nil) ⇒ Response
- #modify_guild_onboarding(guild_id, body, reason: nil) ⇒ Response
- #modify_guild_role(guild_id, role_id, body, reason: nil) ⇒ Response
- #modify_guild_role_positions(guild_id, body, reason: nil) ⇒ Response
- #modify_guild_scheduled_event(guild_id, guild_scheduled_event_id, body, reason: nil) ⇒ Response
- #modify_guild_soundboard_sound(guild_id, sound_id, body, reason: nil) ⇒ Response
- #modify_guild_sticker(guild_id, sticker_id, body, reason: nil) ⇒ Response
- #modify_guild_template(guild_id, template_code, body, reason: nil) ⇒ Response
- #modify_guild_welcome_screen(guild_id, body, reason: nil) ⇒ Response
- #modify_guild_widget(guild_id, body, reason: nil) ⇒ Response
- #modify_lobby(lobby_id, body, reason: nil) ⇒ Response
- #modify_stage_instance(channel_id, body, reason: nil) ⇒ Response
- #modify_user_voice_state(guild_id, user_id, body, reason: nil) ⇒ Response
- #modify_webhook(webhook_id, body, reason: nil) ⇒ Response
- #modify_webhook_with_token(webhook_id, webhook_token, body, reason: nil) ⇒ Response
- #oauth2_request_token(user, pass, query) ⇒ Response
- #oauth2_revoke_token(user, pass, query) ⇒ Response
- #pin_message(channel_id, message_id, reason: nil) ⇒ Response
- #remove_guild_ban(guild_id, user_id, reason: nil) ⇒ Response
- #remove_guild_member(guild_id, user_id, reason: nil) ⇒ Response
- #remove_guild_member_role(guild_id, user_id, role_id, reason: nil) ⇒ Response
- #remove_member_from_lobby(lobby_id, user_id, reason: nil) ⇒ Response
- #remove_thread_member(channel_id, user_id, reason: nil) ⇒ Response
- #search_guild_members(guild_id, query = {}, reason: nil) ⇒ Response
- #send_soundboard_sound(channel_id, body, reason: nil) ⇒ Response
- #start_thread_from_message(channel_id, message_id, body, reason: nil) ⇒ Response
- #start_thread_in_forum_or_media_channel(channel_id, body, reason: nil) ⇒ Response
- #start_thread_without_message(channel_id, body, reason: nil) ⇒ Response
- #sync_guild_template(guild_id, template_code, reason: nil) ⇒ Response
- #trigger_typing_indicator(channel_id, reason: nil) ⇒ Response
- #unlink_channel_from_lobby(lobby_id, reason: nil) ⇒ Response
- #unpin_message(channel_id, message_id, reason: nil) ⇒ Response
- #update_application_role_connection_metadata_records(application_id, body, reason: nil) ⇒ Response
- #update_current_user_application_role_connection(application_id, body, reason: nil) ⇒ Response
Constructor Details
#initialize(auth = nil, user_agent: "LibDiscord (#{LibDiscord::PROJECT_URL}, #{LibDiscord.version})", logger: nil) ⇒ self
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/lib_discord/client.rb', line 61 def initialize( auth = nil, user_agent: "LibDiscord (#{LibDiscord::PROJECT_URL}, #{LibDiscord.version})", logger: nil ) @default_headers = { "User-Agent" => user_agent, "Authorization" => auth }.compact @logger = logger unless @logger @logger = Logger.new($stdout) @logger.level = :info end end |
Instance Method Details
#add_guild_member(guild_id, user_id, body, reason: nil) ⇒ Response
1914 1915 1916 1917 1918 1919 1920 1921 |
# File 'lib/lib_discord/client.rb', line 1914 def add_guild_member(guild_id, user_id, body, reason: nil) json_request( :put, discord("/guilds/#{guild_id}/members/#{user_id}"), body:, headers: auditlog(reason) ) end |
#add_guild_member_role(guild_id, user_id, role_id, reason: nil) ⇒ Response
1986 1987 1988 1989 1990 1991 1992 |
# File 'lib/lib_discord/client.rb', line 1986 def add_guild_member_role(guild_id, user_id, role_id, reason: nil) json_request( :put, discord("/guilds/#{guild_id}/members/#{user_id}/roles/#{role_id}"), headers: auditlog(reason) ) end |
#add_member_to_lobby(lobby_id, user_id, body, reason: nil) ⇒ Response
2594 2595 2596 2597 2598 2599 2600 2601 |
# File 'lib/lib_discord/client.rb', line 2594 def add_member_to_lobby(lobby_id, user_id, body, reason: nil) json_request( :put, discord("/lobbies/#{lobby_id}/members/#{user_id}"), body:, headers: auditlog(reason) ) end |
#add_thread_member(channel_id, user_id, reason: nil) ⇒ Response
1105 1106 1107 1108 1109 1110 1111 |
# File 'lib/lib_discord/client.rb', line 1105 def add_thread_member(channel_id, user_id, reason: nil) json_request( :put, discord("/channels/#{channel_id}/thread-members/#{user_id}"), headers: auditlog(reason) ) end |
#batch_edit_application_command_permissions(application_id, guild_id, body, reason: nil) ⇒ Response
This endpoint has been disabled with updates to command permissions (Permissions v2). Instead, you can edit each application command permissions (though you should be careful to handle any potential rate limits).
574 575 576 577 578 579 580 581 |
# File 'lib/lib_discord/client.rb', line 574 def (application_id, guild_id, body, reason: nil) json_request( :put, discord("/applications/#{application_id}/guilds/#{guild_id}/commands/permissions"), body:, headers: auditlog(reason) ) end |
#begin_guild_prune(guild_id, body, reason: nil) ⇒ Response
2252 2253 2254 2255 2256 2257 2258 2259 |
# File 'lib/lib_discord/client.rb', line 2252 def begin_guild_prune(guild_id, body, reason: nil) json_request( :post, discord("/guilds/#{guild_id}/prune"), body:, headers: auditlog(reason) ) end |
#bulk_delete_messages(channel_id, body, reason: nil) ⇒ Response
2882 2883 2884 2885 2886 2887 2888 2889 |
# File 'lib/lib_discord/client.rb', line 2882 def (channel_id, body, reason: nil) json_request( :post, discord("/channels/#{channel_id}/messages/bulk-delete"), body:, headers: auditlog(reason) ) end |
#bulk_guild_ban(guild_id, body, reason: nil) ⇒ Response
2102 2103 2104 2105 2106 2107 2108 2109 |
# File 'lib/lib_discord/client.rb', line 2102 def bulk_guild_ban(guild_id, body, reason: nil) json_request( :post, discord("/guilds/#{guild_id}/bulk-ban"), body:, headers: auditlog(reason) ) end |
#bulk_overwrite_global_application_commands(application_id, body, reason: nil) ⇒ Response
390 391 392 393 394 395 396 397 |
# File 'lib/lib_discord/client.rb', line 390 def bulk_overwrite_global_application_commands(application_id, body, reason: nil) json_request( :put, discord("/applications/#{application_id}/commands"), body:, headers: auditlog(reason) ) end |
#bulk_overwrite_guild_application_commands(application_id, guild_id, body, reason: nil) ⇒ Response
497 498 499 500 501 502 503 504 |
# File 'lib/lib_discord/client.rb', line 497 def bulk_overwrite_guild_application_commands(application_id, guild_id, body, reason: nil) json_request( :put, discord("/applications/#{application_id}/guilds/#{guild_id}/commands"), body:, headers: auditlog(reason) ) end |
#consume_entitlement(application_id, entitlement_id, reason: nil) ⇒ Response
1441 1442 1443 1444 1445 1446 1447 |
# File 'lib/lib_discord/client.rb', line 1441 def consume_entitlement(application_id, entitlement_id, reason: nil) json_request( :post, discord("/applications/#{application_id}/entitlements/#{entitlement_id}/consume"), headers: auditlog(reason) ) end |
#create_application_emoji(application_id, body, reason: nil) ⇒ Response
1355 1356 1357 1358 1359 1360 1361 1362 |
# File 'lib/lib_discord/client.rb', line 1355 def create_application_emoji(application_id, body, reason: nil) json_request( :post, discord("/applications/#{application_id}/emojis"), body:, headers: auditlog(reason) ) end |
#create_auto_moderation_rule(guild_id, body, reason: nil) ⇒ Response
755 756 757 758 759 760 761 762 |
# File 'lib/lib_discord/client.rb', line 755 def create_auto_moderation_rule(guild_id, body, reason: nil) json_request( :post, discord("/guilds/#{guild_id}/auto-moderation/rules"), body:, headers: auditlog(reason) ) end |
#create_channel_invite(channel_id, body, reason: nil) ⇒ Response
892 893 894 895 896 897 898 899 |
# File 'lib/lib_discord/client.rb', line 892 def create_channel_invite(channel_id, body, reason: nil) json_request( :post, discord("/channels/#{channel_id}/invites"), body:, headers: auditlog(reason) ) end |
#create_dm(body, reason: nil) ⇒ Response
3401 3402 3403 3404 3405 3406 3407 3408 |
# File 'lib/lib_discord/client.rb', line 3401 def create_dm(body, reason: nil) json_request( :post, discord("/users/@me/channels"), body:, headers: auditlog(reason) ) end |
#create_followup_message(application_id, interaction_token, body, reason: nil) ⇒ Response
232 233 234 235 236 237 238 239 |
# File 'lib/lib_discord/client.rb', line 232 def (application_id, interaction_token, body, reason: nil) json_request( :post, discord("/webhooks/#{application_id}/#{interaction_token}"), body:, headers: auditlog(reason) ) end |
#create_global_application_command(application_id, body, reason: nil) ⇒ Response
323 324 325 326 327 328 329 330 |
# File 'lib/lib_discord/client.rb', line 323 def create_global_application_command(application_id, body, reason: nil) json_request( :post, discord("/applications/#{application_id}/commands"), body:, headers: auditlog(reason) ) end |
#create_group_dm(body, reason: nil) ⇒ Response
3417 3418 3419 3420 3421 3422 3423 3424 |
# File 'lib/lib_discord/client.rb', line 3417 def create_group_dm(body, reason: nil) json_request( :post, discord("/users/@me/channels"), body:, headers: auditlog(reason) ) end |
#create_guild(body, reason: nil) ⇒ Response
1718 1719 1720 1721 1722 1723 1724 1725 |
# File 'lib/lib_discord/client.rb', line 1718 def create_guild(body, reason: nil) json_request( :post, discord("/guilds"), body:, headers: auditlog(reason) ) end |
#create_guild_application_command(application_id, guild_id, body, reason: nil) ⇒ Response
426 427 428 429 430 431 432 433 |
# File 'lib/lib_discord/client.rb', line 426 def create_guild_application_command(application_id, guild_id, body, reason: nil) json_request( :post, discord("/applications/#{application_id}/guilds/#{guild_id}/commands"), body:, headers: auditlog(reason) ) end |
#create_guild_ban(guild_id, user_id, body, reason: nil) ⇒ Response
2069 2070 2071 2072 2073 2074 2075 2076 |
# File 'lib/lib_discord/client.rb', line 2069 def create_guild_ban(guild_id, user_id, body, reason: nil) json_request( :put, discord("/guilds/#{guild_id}/bans/#{user_id}"), body:, headers: auditlog(reason) ) end |
#create_guild_channel(guild_id, body, reason: nil) ⇒ Response
1814 1815 1816 1817 1818 1819 1820 1821 |
# File 'lib/lib_discord/client.rb', line 1814 def create_guild_channel(guild_id, body, reason: nil) json_request( :post, discord("/guilds/#{guild_id}/channels"), body:, headers: auditlog(reason) ) end |
#create_guild_emoji(guild_id, body, reason: nil) ⇒ Response
1273 1274 1275 1276 1277 1278 1279 1280 |
# File 'lib/lib_discord/client.rb', line 1273 def create_guild_emoji(guild_id, body, reason: nil) json_request( :post, discord("/guilds/#{guild_id}/emojis"), body:, headers: auditlog(reason) ) end |
#create_guild_from_guild_template(template_code, body, reason: nil) ⇒ Response
1616 1617 1618 1619 1620 1621 1622 1623 |
# File 'lib/lib_discord/client.rb', line 1616 def create_guild_from_guild_template(template_code, body, reason: nil) json_request( :post, discord("/guilds/templates/#{template_code}"), body:, headers: auditlog(reason) ) end |
#create_guild_role(guild_id, body, reason: nil) ⇒ Response
2150 2151 2152 2153 2154 2155 2156 2157 |
# File 'lib/lib_discord/client.rb', line 2150 def create_guild_role(guild_id, body, reason: nil) json_request( :post, discord("/guilds/#{guild_id}/roles"), body:, headers: auditlog(reason) ) end |
#create_guild_scheduled_event(guild_id, body, reason: nil) ⇒ Response
1510 1511 1512 1513 1514 1515 1516 1517 |
# File 'lib/lib_discord/client.rb', line 1510 def create_guild_scheduled_event(guild_id, body, reason: nil) json_request( :post, discord("/guilds/#{guild_id}/scheduled-events"), body:, headers: auditlog(reason) ) end |
#create_guild_soundboard_sound(guild_id, body, reason: nil) ⇒ Response
3023 3024 3025 3026 3027 3028 3029 3030 |
# File 'lib/lib_discord/client.rb', line 3023 def create_guild_soundboard_sound(guild_id, body, reason: nil) json_request( :post, discord("/guilds/#{guild_id}/soundboard-sounds"), body:, headers: auditlog(reason) ) end |
#create_guild_sticker(guild_id, body, reason: nil) ⇒ Response
3220 3221 3222 3223 3224 3225 3226 3227 |
# File 'lib/lib_discord/client.rb', line 3220 def create_guild_sticker(guild_id, body, reason: nil) json_request( :post, discord("/guilds/#{guild_id}/stickers"), body:, headers: auditlog(reason) ) end |
#create_guild_template(guild_id, body, reason: nil) ⇒ Response
1648 1649 1650 1651 1652 1653 1654 1655 |
# File 'lib/lib_discord/client.rb', line 1648 def create_guild_template(guild_id, body, reason: nil) json_request( :post, discord("/guilds/#{guild_id}/templates"), body:, headers: auditlog(reason) ) end |
#create_interaction_response(interaction_id, interaction_token, body, reason: nil) ⇒ Response
164 165 166 167 168 169 170 171 |
# File 'lib/lib_discord/client.rb', line 164 def create_interaction_response(interaction_id, interaction_token, body, reason: nil) json_request( :post, discord("/interactions/#{interaction_id}/#{interaction_token}/callback"), body:, headers: auditlog(reason) ) end |
#create_lobby(body, reason: nil) ⇒ Response
2529 2530 2531 2532 2533 2534 2535 2536 |
# File 'lib/lib_discord/client.rb', line 2529 def create_lobby(body, reason: nil) json_request( :post, discord("/lobbies"), body:, headers: auditlog(reason) ) end |
#create_message(channel_id, body, reason: nil) ⇒ Response
2711 2712 2713 2714 2715 2716 2717 2718 |
# File 'lib/lib_discord/client.rb', line 2711 def (channel_id, body, reason: nil) json_request( :post, discord("/channels/#{channel_id}/messages"), body:, headers: auditlog(reason) ) end |
#create_reaction(channel_id, message_id, emoji, reason: nil) ⇒ Response
2745 2746 2747 2748 2749 2750 2751 |
# File 'lib/lib_discord/client.rb', line 2745 def create_reaction(channel_id, , emoji, reason: nil) json_request( :put, discord("/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}/@me"), headers: auditlog(reason) ) end |
#create_stage_instance(body, reason: nil) ⇒ Response
3077 3078 3079 3080 3081 3082 3083 3084 |
# File 'lib/lib_discord/client.rb', line 3077 def create_stage_instance(body, reason: nil) json_request( :post, discord("/stage-instances"), body:, headers: auditlog(reason) ) end |
#create_test_entitlement(application_id, body, reason: nil) ⇒ Response
1456 1457 1458 1459 1460 1461 1462 1463 |
# File 'lib/lib_discord/client.rb', line 1456 def create_test_entitlement(application_id, body, reason: nil) json_request( :post, discord("/applications/#{application_id}/entitlements"), body:, headers: auditlog(reason) ) end |
#create_webhook(channel_id, body, reason: nil) ⇒ Response
3568 3569 3570 3571 3572 3573 3574 3575 |
# File 'lib/lib_discord/client.rb', line 3568 def create_webhook(channel_id, body, reason: nil) json_request( :post, discord("/channels/#{channel_id}/webhooks"), body:, headers: auditlog(reason) ) end |
#crosspost_message(channel_id, message_id, reason: nil) ⇒ Response
2728 2729 2730 2731 2732 2733 2734 |
# File 'lib/lib_discord/client.rb', line 2728 def (channel_id, , reason: nil) json_request( :post, discord("/channels/#{channel_id}/messages/#{message_id}/crosspost"), headers: auditlog(reason) ) end |
#delete_all_reactions(channel_id, message_id, reason: nil) ⇒ Response
2815 2816 2817 2818 2819 2820 2821 |
# File 'lib/lib_discord/client.rb', line 2815 def delete_all_reactions(channel_id, , reason: nil) json_request( :delete, discord("/channels/#{channel_id}/messages/#{message_id}/reactions"), headers: auditlog(reason) ) end |
#delete_all_reactions_for_emoji(channel_id, message_id, emoji, reason: nil) ⇒ Response
2832 2833 2834 2835 2836 2837 2838 |
# File 'lib/lib_discord/client.rb', line 2832 def delete_all_reactions_for_emoji(channel_id, , emoji, reason: nil) json_request( :delete, discord("/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}"), headers: auditlog(reason) ) end |
#delete_application_emoji(application_id, emoji_id, reason: nil) ⇒ Response
1390 1391 1392 1393 1394 1395 1396 |
# File 'lib/lib_discord/client.rb', line 1390 def delete_application_emoji(application_id, emoji_id, reason: nil) json_request( :delete, discord("/applications/#{application_id}/emojis/#{emoji_id}"), headers: auditlog(reason) ) end |
#delete_auto_moderation_rule(guild_id, auto_moderation_rule_id, reason: nil) ⇒ Response
790 791 792 793 794 795 796 |
# File 'lib/lib_discord/client.rb', line 790 def delete_auto_moderation_rule(guild_id, auto_moderation_rule_id, reason: nil) json_request( :delete, discord("/guilds/#{guild_id}/auto-moderation/rules/#{auto_moderation_rule_id}"), headers: auditlog(reason) ) end |
#delete_channel(channel_id, reason: nil) ⇒ Response Also known as: close_channel
841 842 843 844 845 846 847 |
# File 'lib/lib_discord/client.rb', line 841 def delete_channel(channel_id, reason: nil) json_request( :delete, discord("/channels/#{channel_id}"), headers: auditlog(reason) ) end |
#delete_channel_permission(channel_id, overwrite_id, reason: nil) ⇒ Response
909 910 911 912 913 914 915 |
# File 'lib/lib_discord/client.rb', line 909 def (channel_id, overwrite_id, reason: nil) json_request( :delete, discord("/channels/#{channel_id}/permissions/#{overwrite_id}"), headers: auditlog(reason) ) end |
#delete_followup_message(application_id, interaction_token, message_id, reason: nil) ⇒ Response
286 287 288 289 290 291 292 |
# File 'lib/lib_discord/client.rb', line 286 def (application_id, interaction_token, , reason: nil) json_request( :delete, discord("/webhooks/#{application_id}/#{interaction_token}/messages/#{message_id}"), headers: auditlog(reason) ) end |
#delete_global_application_command(application_id, command_id, reason: nil) ⇒ Response
374 375 376 377 378 379 380 |
# File 'lib/lib_discord/client.rb', line 374 def delete_global_application_command(application_id, command_id, reason: nil) json_request( :delete, discord("/applications/#{application_id}/commands/#{command_id}"), headers: auditlog(reason) ) end |
#delete_guild(guild_id, reason: nil) ⇒ Response
1783 1784 1785 1786 1787 1788 1789 |
# File 'lib/lib_discord/client.rb', line 1783 def delete_guild(guild_id, reason: nil) json_request( :delete, discord("/guilds/#{guild_id}"), headers: auditlog(reason) ) end |
#delete_guild_application_command(application_id, guild_id, command_id, reason: nil) ⇒ Response
480 481 482 483 484 485 486 |
# File 'lib/lib_discord/client.rb', line 480 def delete_guild_application_command(application_id, guild_id, command_id, reason: nil) json_request( :delete, discord("/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}"), headers: auditlog(reason) ) end |
#delete_guild_emoji(guild_id, emoji_id, reason: nil) ⇒ Response
1308 1309 1310 1311 1312 1313 1314 |
# File 'lib/lib_discord/client.rb', line 1308 def delete_guild_emoji(guild_id, emoji_id, reason: nil) json_request( :delete, discord("/guilds/#{guild_id}/emojis/#{emoji_id}"), headers: auditlog(reason) ) end |
#delete_guild_integration(guild_id, integration_id, reason: nil) ⇒ Response
2314 2315 2316 2317 2318 2319 2320 |
# File 'lib/lib_discord/client.rb', line 2314 def delete_guild_integration(guild_id, integration_id, reason: nil) json_request( :delete, discord("/guilds/#{guild_id}/integrations/#{integration_id}"), headers: auditlog(reason) ) end |
#delete_guild_role(guild_id, role_id, reason: nil) ⇒ Response
2219 2220 2221 2222 2223 2224 2225 |
# File 'lib/lib_discord/client.rb', line 2219 def delete_guild_role(guild_id, role_id, reason: nil) json_request( :delete, discord("/guilds/#{guild_id}/roles/#{role_id}"), headers: auditlog(reason) ) end |
#delete_guild_scheduled_event(guild_id, guild_scheduled_event_id, reason: nil) ⇒ Response
1563 1564 1565 1566 1567 1568 1569 |
# File 'lib/lib_discord/client.rb', line 1563 def delete_guild_scheduled_event(guild_id, guild_scheduled_event_id, reason: nil) json_request( :delete, discord("/guilds/#{guild_id}/scheduled-events/#{guild_scheduled_event_id}"), headers: auditlog(reason) ) end |
#delete_guild_soundboard_sound(guild_id, sound_id, reason: nil) ⇒ Response
3058 3059 3060 3061 3062 3063 3064 |
# File 'lib/lib_discord/client.rb', line 3058 def delete_guild_soundboard_sound(guild_id, sound_id, reason: nil) json_request( :delete, discord("/guilds/#{guild_id}/soundboard-sounds/#{sound_id}"), headers: auditlog(reason) ) end |
#delete_guild_sticker(guild_id, sticker_id, reason: nil) ⇒ Response
3255 3256 3257 3258 3259 3260 3261 |
# File 'lib/lib_discord/client.rb', line 3255 def delete_guild_sticker(guild_id, sticker_id, reason: nil) json_request( :delete, discord("/guilds/#{guild_id}/stickers/#{sticker_id}"), headers: auditlog(reason) ) end |
#delete_guild_template(guild_id, template_code, reason: nil) ⇒ Response
1699 1700 1701 1702 1703 1704 1705 |
# File 'lib/lib_discord/client.rb', line 1699 def delete_guild_template(guild_id, template_code, reason: nil) json_request( :delete, discord("/guilds/#{guild_id}/templates/#{template_code}"), headers: auditlog(reason) ) end |
#delete_invite(invite_code, reason: nil) ⇒ Response
2510 2511 2512 2513 2514 2515 2516 |
# File 'lib/lib_discord/client.rb', line 2510 def delete_invite(invite_code, reason: nil) json_request( :delete, discord("/invites/#{invite_code}"), headers: auditlog(reason) ) end |
#delete_lobby(lobby_id, reason: nil) ⇒ Response
2577 2578 2579 2580 2581 2582 2583 |
# File 'lib/lib_discord/client.rb', line 2577 def delete_lobby(lobby_id, reason: nil) json_request( :delete, discord("/lobbies/#{lobby_id}"), headers: auditlog(reason) ) end |
#delete_message(channel_id, message_id, reason: nil) ⇒ Response
2866 2867 2868 2869 2870 2871 2872 |
# File 'lib/lib_discord/client.rb', line 2866 def (channel_id, , reason: nil) json_request( :delete, discord("/channels/#{channel_id}/messages/#{message_id}"), headers: auditlog(reason) ) end |
#delete_original_interaction_response(application_id, interaction_token, reason: nil) ⇒ Response
215 216 217 218 219 220 221 |
# File 'lib/lib_discord/client.rb', line 215 def delete_original_interaction_response(application_id, interaction_token, reason: nil) json_request( :delete, discord("/webhooks/#{application_id}/#{interaction_token}/messages/@original"), headers: auditlog(reason) ) end |
#delete_own_reaction(channel_id, message_id, emoji, reason: nil) ⇒ Response
2762 2763 2764 2765 2766 2767 2768 |
# File 'lib/lib_discord/client.rb', line 2762 def delete_own_reaction(channel_id, , emoji, reason: nil) json_request( :delete, discord("/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}/@me"), headers: auditlog(reason) ) end |
#delete_stage_instance(channel_id, reason: nil) ⇒ Response
3125 3126 3127 3128 3129 3130 3131 |
# File 'lib/lib_discord/client.rb', line 3125 def delete_stage_instance(channel_id, reason: nil) json_request( :delete, discord("/stage-instances/#{channel_id}"), headers: auditlog(reason) ) end |
#delete_test_entitlement(application_id, entitlement_id, reason: nil) ⇒ Response
1473 1474 1475 1476 1477 1478 1479 |
# File 'lib/lib_discord/client.rb', line 1473 def delete_test_entitlement(application_id, entitlement_id, reason: nil) json_request( :delete, discord("/applications/#{application_id}/entitlements/#{entitlement_id}"), headers: auditlog(reason) ) end |
#delete_user_reaction(channel_id, message_id, emoji, user_id, reason: nil) ⇒ Response
2780 2781 2782 2783 2784 2785 2786 |
# File 'lib/lib_discord/client.rb', line 2780 def delete_user_reaction(channel_id, , emoji, user_id, reason: nil) json_request( :delete, discord("/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}/#{user_id}"), headers: auditlog(reason) ) end |
#delete_webhook(webhook_id, reason: nil) ⇒ Response
3680 3681 3682 3683 3684 3685 3686 |
# File 'lib/lib_discord/client.rb', line 3680 def delete_webhook(webhook_id, reason: nil) json_request( :delete, discord("/webhooks/#{webhook_id}"), headers: auditlog(reason) ) end |
#delete_webhook_message(webhook_id, webhook_token, message_id, reason: nil) ⇒ Response
3809 3810 3811 3812 3813 3814 3815 |
# File 'lib/lib_discord/client.rb', line 3809 def (webhook_id, webhook_token, , reason: nil) json_request( :delete, discord("/webhooks/#{webhook_id}/#{webhook_token}/messages/#{message_id}"), headers: auditlog(reason) ) end |
#delete_webhook_with_token(webhook_id, webhook_token, reason: nil) ⇒ Response
3696 3697 3698 3699 3700 3701 3702 |
# File 'lib/lib_discord/client.rb', line 3696 def delete_webhook_with_token(webhook_id, webhook_token, reason: nil) json_request( :delete, discord("/webhooks/#{webhook_id}/#{webhook_token}"), headers: auditlog(reason) ) end |
#edit_application_command_permissions(application_id, guild_id, command_id, body, reason: nil) ⇒ Response
549 550 551 552 553 554 555 556 |
# File 'lib/lib_discord/client.rb', line 549 def (application_id, guild_id, command_id, body, reason: nil) json_request( :put, discord("/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}/permissions"), body:, headers: auditlog(reason) ) end |
#edit_channel_permissions(channel_id, overwrite_id, body, reason: nil) ⇒ Response
860 861 862 863 864 865 866 867 |
# File 'lib/lib_discord/client.rb', line 860 def (channel_id, overwrite_id, body, reason: nil) json_request( :put, discord("/channels/#{channel_id}/permissions/#{overwrite_id}"), body:, headers: auditlog(reason) ) end |
#edit_current_application(body, reason: nil) ⇒ Response
666 667 668 669 670 671 672 673 |
# File 'lib/lib_discord/client.rb', line 666 def edit_current_application(body, reason: nil) json_request( :patch, discord("/applications/@me"), body:, headers: auditlog(reason) ) end |
#edit_followup_message(application_id, interaction_token, message_id, body, reason: nil) ⇒ Response
268 269 270 271 272 273 274 275 |
# File 'lib/lib_discord/client.rb', line 268 def (application_id, interaction_token, , body, reason: nil) json_request( :patch, discord("/webhooks/#{application_id}/#{interaction_token}/messages/#{message_id}"), body:, headers: auditlog(reason) ) end |
#edit_global_application_command(application_id, command_id, body, reason: nil) ⇒ Response
357 358 359 360 361 362 363 364 |
# File 'lib/lib_discord/client.rb', line 357 def edit_global_application_command(application_id, command_id, body, reason: nil) json_request( :patch, discord("/applications/#{application_id}/commands/#{command_id}"), body:, headers: auditlog(reason) ) end |
#edit_guild_application_command(application_id, guild_id, command_id, body, reason: nil) ⇒ Response
462 463 464 465 466 467 468 469 |
# File 'lib/lib_discord/client.rb', line 462 def edit_guild_application_command(application_id, guild_id, command_id, body, reason: nil) json_request( :patch, discord("/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}"), body:, headers: auditlog(reason) ) end |
#edit_message(channel_id, message_id, body, reason: nil) ⇒ Response
2849 2850 2851 2852 2853 2854 2855 2856 |
# File 'lib/lib_discord/client.rb', line 2849 def (channel_id, , body, reason: nil) json_request( :patch, discord("/channels/#{channel_id}/messages/#{message_id}"), body:, headers: auditlog(reason) ) end |
#edit_original_interaction_response(application_id, interaction_token, body, reason: nil) ⇒ Response
198 199 200 201 202 203 204 205 |
# File 'lib/lib_discord/client.rb', line 198 def edit_original_interaction_response(application_id, interaction_token, body, reason: nil) json_request( :patch, discord("/webhooks/#{application_id}/#{interaction_token}/messages/@original"), body:, headers: auditlog(reason) ) end |
#edit_webhook_message(webhook_id, webhook_token, message_id, body, query = {}, reason: nil) ⇒ Response
3790 3791 3792 3793 3794 3795 3796 3797 3798 |
# File 'lib/lib_discord/client.rb', line 3790 def (webhook_id, webhook_token, , body, query = {}, reason: nil) json_request( :patch, discord("/webhooks/#{webhook_id}/#{webhook_token}/messages/#{message_id}"), body:, query:, headers: auditlog(reason) ) end |
#end_poll(channel_id, message_id, reason: nil) ⇒ Response
2922 2923 2924 2925 2926 2927 2928 |
# File 'lib/lib_discord/client.rb', line 2922 def end_poll(channel_id, , reason: nil) json_request( :post, discord("/channels/#{channel_id}/polls/#{message_id}/expire"), headers: auditlog(reason) ) end |
#execute_github_compatible_webhook(webhook_id, webhook_token, query = {}, reason: nil) ⇒ Response
3751 3752 3753 3754 3755 3756 3757 3758 |
# File 'lib/lib_discord/client.rb', line 3751 def execute_github_compatible_webhook(webhook_id, webhook_token, query = {}, reason: nil) json_request( :post, discord("/webhooks/#{webhook_id}/#{webhook_token}/github"), query:, headers: auditlog(reason) ) end |
#execute_slack_compatible_webhook(webhook_id, webhook_token, query = {}, reason: nil) ⇒ Response
3733 3734 3735 3736 3737 3738 3739 3740 |
# File 'lib/lib_discord/client.rb', line 3733 def execute_slack_compatible_webhook(webhook_id, webhook_token, query = {}, reason: nil) json_request( :post, discord("/webhooks/#{webhook_id}/#{webhook_token}/slack"), query:, headers: auditlog(reason) ) end |
#execute_webhook(webhook_id, webhook_token, body, query = {}, reason: nil) ⇒ Response
3714 3715 3716 3717 3718 3719 3720 3721 3722 |
# File 'lib/lib_discord/client.rb', line 3714 def execute_webhook(webhook_id, webhook_token, body, query = {}, reason: nil) json_request( :post, discord("/webhooks/#{webhook_id}/#{webhook_token}"), body:, query:, headers: auditlog(reason) ) end |
#follow_announcement_channel(channel_id, body, reason: nil) ⇒ Response
925 926 927 928 929 930 931 932 |
# File 'lib/lib_discord/client.rb', line 925 def follow_announcement_channel(channel_id, body, reason: nil) json_request( :post, discord("/channels/#{channel_id}/followers"), body:, headers: auditlog(reason) ) end |
#get_answer_voters(channel_id, message_id, answer_id, query = {}, reason: nil) ⇒ Response
2905 2906 2907 2908 2909 2910 2911 2912 |
# File 'lib/lib_discord/client.rb', line 2905 def get_answer_voters(channel_id, , answer_id, query = {}, reason: nil) json_request( :get, discord("/channels/#{channel_id}/polls/#{message_id}/answers/#{answer_id}"), query:, headers: auditlog(reason) ) end |
#get_application_activity_instance(application_id, instance_id, reason: nil) ⇒ Response
683 684 685 686 687 688 689 |
# File 'lib/lib_discord/client.rb', line 683 def get_application_activity_instance(application_id, instance_id, reason: nil) json_request( :get, discord("/applications/#{application_id}/activity-instances/#{instance_id}"), headers: auditlog(reason) ) end |
#get_application_command_permissions(application_id, guild_id, command_id, reason: nil) ⇒ Response
531 532 533 534 535 536 537 |
# File 'lib/lib_discord/client.rb', line 531 def (application_id, guild_id, command_id, reason: nil) json_request( :get, discord("/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}/permissions"), headers: auditlog(reason) ) end |
#get_application_emoji(application_id, emoji_id, reason: nil) ⇒ Response
1339 1340 1341 1342 1343 1344 1345 |
# File 'lib/lib_discord/client.rb', line 1339 def get_application_emoji(application_id, emoji_id, reason: nil) json_request( :get, discord("/applications/#{application_id}/emojis/#{emoji_id}"), headers: auditlog(reason) ) end |
#get_application_role_connection_metadata_records(application_id, reason: nil) ⇒ Response
619 620 621 622 623 624 625 |
# File 'lib/lib_discord/client.rb', line 619 def (application_id, reason: nil) json_request( :get, discord("/applications/#{application_id}/role-connections/metadata"), headers: auditlog(reason) ) end |
#get_authorize_url(query = {}) ⇒ URI
Get the URL for starting the OAuth2 Authorization flow.
3866 3867 3868 3869 3870 |
# File 'lib/lib_discord/client.rb', line 3866 def (query = {}) uri = URI(discord("/oauth2/authorize", prefix: "")) uri.query = URI.encode_www_form(query) uri end |
#get_auto_moderation_rule(guild_id, auto_moderation_rule_id, reason: nil) ⇒ Response
739 740 741 742 743 744 745 |
# File 'lib/lib_discord/client.rb', line 739 def get_auto_moderation_rule(guild_id, auto_moderation_rule_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/auto-moderation/rules/#{auto_moderation_rule_id}"), headers: auditlog(reason) ) end |
#get_channel(channel_id, reason: nil) ⇒ Response
809 810 811 812 813 814 815 |
# File 'lib/lib_discord/client.rb', line 809 def get_channel(channel_id, reason: nil) json_request( :get, discord("/channels/#{channel_id}"), headers: auditlog(reason) ) end |
#get_channel_invites(channel_id, reason: nil) ⇒ Response
876 877 878 879 880 881 882 |
# File 'lib/lib_discord/client.rb', line 876 def get_channel_invites(channel_id, reason: nil) json_request( :get, discord("/channels/#{channel_id}/invites"), headers: auditlog(reason) ) end |
#get_channel_message(channel_id, message_id, reason: nil) ⇒ Response
2695 2696 2697 2698 2699 2700 2701 |
# File 'lib/lib_discord/client.rb', line 2695 def (channel_id, , reason: nil) json_request( :get, discord("/channels/#{channel_id}/messages/#{message_id}"), headers: auditlog(reason) ) end |
#get_channel_messages(channel_id, query = {}, reason: nil) ⇒ Response
2678 2679 2680 2681 2682 2683 2684 2685 |
# File 'lib/lib_discord/client.rb', line 2678 def (channel_id, query = {}, reason: nil) json_request( :get, discord("/channels/#{channel_id}/messages"), query:, headers: auditlog(reason) ) end |
#get_channel_webhooks(channel_id, reason: nil) ⇒ Response
3584 3585 3586 3587 3588 3589 3590 |
# File 'lib/lib_discord/client.rb', line 3584 def get_channel_webhooks(channel_id, reason: nil) json_request( :get, discord("/channels/#{channel_id}/webhooks"), headers: auditlog(reason) ) end |
#get_current_application(reason: nil) ⇒ Response
655 656 657 |
# File 'lib/lib_discord/client.rb', line 655 def get_current_application(reason: nil) json_request(:get, discord("/applications/@me"), headers: auditlog(reason)) end |
#get_current_user(reason: nil) ⇒ Response
3310 3311 3312 3313 3314 3315 |
# File 'lib/lib_discord/client.rb', line 3310 def get_current_user(reason: nil) json_request( :get, discord("/users/@me"), headers: auditlog(reason) ) end |
#get_current_user_application_role_connection(application_id, reason: nil) ⇒ Response
3447 3448 3449 3450 3451 3452 3453 |
# File 'lib/lib_discord/client.rb', line 3447 def get_current_user_application_role_connection(application_id, reason: nil) json_request( :get, discord("/users/@me/applications/#{application_id}/role-connections"), headers: auditlog(reason) ) end |
#get_current_user_connections(reason: nil) ⇒ Response
3432 3433 3434 3435 3436 3437 3438 |
# File 'lib/lib_discord/client.rb', line 3432 def get_current_user_connections(reason: nil) json_request( :get, discord("/users/@me/connections"), headers: auditlog(reason) ) end |
#get_current_user_guild_member(guild_id, reason: nil) ⇒ Response
3371 3372 3373 3374 3375 3376 3377 |
# File 'lib/lib_discord/client.rb', line 3371 def get_current_user_guild_member(guild_id, reason: nil) json_request( :get, discord("/users/@me/guilds/#{guild_id}/member"), headers: auditlog(reason) ) end |
#get_current_user_guilds(query = {}, reason: nil) ⇒ Response
3355 3356 3357 3358 3359 3360 3361 3362 |
# File 'lib/lib_discord/client.rb', line 3355 def get_current_user_guilds(query = {}, reason: nil) json_request( :get, discord("/users/@me/guilds"), query:, headers: auditlog(reason) ) end |
#get_current_user_voice_state(guild_id, reason: nil) ⇒ Response
3497 3498 3499 3500 3501 3502 3503 |
# File 'lib/lib_discord/client.rb', line 3497 def get_current_user_voice_state(guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/voice-states/@me"), headers: auditlog(reason) ) end |
#get_entitlement(application_id, entitlement_id, reason: nil) ⇒ Response
1425 1426 1427 1428 1429 1430 1431 |
# File 'lib/lib_discord/client.rb', line 1425 def get_entitlement(application_id, entitlement_id, reason: nil) json_request( :get, discord("/applications/#{application_id}/entitlements/#{entitlement_id}"), headers: auditlog(reason) ) end |
#get_followup_message(application_id, interaction_token, message_id, reason: nil) ⇒ Response
250 251 252 253 254 255 256 |
# File 'lib/lib_discord/client.rb', line 250 def (application_id, interaction_token, , reason: nil) json_request( :get, discord("/webhooks/#{application_id}/#{interaction_token}/messages/#{message_id}"), headers: auditlog(reason) ) end |
#get_gateway(reason: nil) ⇒ Response
593 594 595 |
# File 'lib/lib_discord/client.rb', line 593 def get_gateway(reason: nil) json_request(:get, discord("/gateway"), headers: auditlog(reason)) end |
#get_gateway_bot(reason: nil) ⇒ Response
603 604 605 |
# File 'lib/lib_discord/client.rb', line 603 def get_gateway_bot(reason: nil) json_request(:get, discord("/gateway/bot"), headers: auditlog(reason)) end |
#get_global_application_command(application_id, command_id, reason: nil) ⇒ Response
340 341 342 343 344 345 346 |
# File 'lib/lib_discord/client.rb', line 340 def get_global_application_command(application_id, command_id, reason: nil) json_request( :get, discord("/applications/#{application_id}/commands/#{command_id}"), headers: auditlog(reason) ) end |
#get_global_application_commands(application_id, query = {}, reason: nil) ⇒ Response
306 307 308 309 310 311 312 313 |
# File 'lib/lib_discord/client.rb', line 306 def get_global_application_commands(application_id, query = {}, reason: nil) json_request( :get, discord("/applications/#{application_id}/commands"), query:, headers: auditlog(reason) ) end |
#get_guild(guild_id, query = {}, reason: nil) ⇒ Response
1735 1736 1737 1738 1739 1740 1741 1742 |
# File 'lib/lib_discord/client.rb', line 1735 def get_guild(guild_id, query = {}, reason: nil) json_request( :get, discord("/guilds/#{guild_id}"), query:, headers: auditlog(reason) ) end |
#get_guild_application_command(application_id, guild_id, command_id, reason: nil) ⇒ Response
444 445 446 447 448 449 450 |
# File 'lib/lib_discord/client.rb', line 444 def get_guild_application_command(application_id, guild_id, command_id, reason: nil) json_request( :get, discord("/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}"), headers: auditlog(reason) ) end |
#get_guild_application_command_permissions(application_id, guild_id, reason: nil) ⇒ Response
514 515 516 517 518 519 520 |
# File 'lib/lib_discord/client.rb', line 514 def (application_id, guild_id, reason: nil) json_request( :get, discord("/applications/#{application_id}/guilds/#{guild_id}/commands/permissions"), headers: auditlog(reason) ) end |
#get_guild_application_commands(application_id, guild_id, query = {}, reason: nil) ⇒ Response
408 409 410 411 412 413 414 415 |
# File 'lib/lib_discord/client.rb', line 408 def get_guild_application_commands(application_id, guild_id, query = {}, reason: nil) json_request( :get, discord("/applications/#{application_id}/guilds/#{guild_id}/commands"), query:, headers: auditlog(reason) ) end |
#get_guild_audit_log(guild_id, query = {}, reason: nil) ⇒ Response
703 704 705 706 707 708 709 710 |
# File 'lib/lib_discord/client.rb', line 703 def get_guild_audit_log(guild_id, query = {}, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/audit-logs"), query:, headers: auditlog(reason) ) end |
#get_guild_ban(guild_id, user_id, reason: nil) ⇒ Response
2052 2053 2054 2055 2056 2057 2058 |
# File 'lib/lib_discord/client.rb', line 2052 def get_guild_ban(guild_id, user_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/bans/#{user_id}"), headers: auditlog(reason) ) end |
#get_guild_bans(guild_id, query = {}, reason: nil) ⇒ Response
2035 2036 2037 2038 2039 2040 2041 2042 |
# File 'lib/lib_discord/client.rb', line 2035 def get_guild_bans(guild_id, query = {}, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/bans"), query:, headers: auditlog(reason) ) end |
#get_guild_channels(guild_id, reason: nil) ⇒ Response
1798 1799 1800 1801 1802 1803 1804 |
# File 'lib/lib_discord/client.rb', line 1798 def get_guild_channels(guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/channels"), headers: auditlog(reason) ) end |
#get_guild_emoji(guild_id, emoji_id, reason: nil) ⇒ Response
1257 1258 1259 1260 1261 1262 1263 |
# File 'lib/lib_discord/client.rb', line 1257 def get_guild_emoji(guild_id, emoji_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/emojis/#{emoji_id}"), headers: auditlog(reason) ) end |
#get_guild_integrations(guild_id, reason: nil) ⇒ Response
2298 2299 2300 2301 2302 2303 2304 |
# File 'lib/lib_discord/client.rb', line 2298 def get_guild_integrations(guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/integrations"), headers: auditlog(reason) ) end |
#get_guild_invites(guild_id, reason: nil) ⇒ Response
2283 2284 2285 2286 2287 2288 2289 |
# File 'lib/lib_discord/client.rb', line 2283 def get_guild_invites(guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/invites"), headers: auditlog(reason) ) end |
#get_guild_member(guild_id, user_id, reason: nil) ⇒ Response
1863 1864 1865 1866 1867 1868 1869 |
# File 'lib/lib_discord/client.rb', line 1863 def get_guild_member(guild_id, user_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/members/#{user_id}"), headers: auditlog(reason) ) end |
#get_guild_onboarding(guild_id, reason: nil) ⇒ Response
2440 2441 2442 2443 2444 2445 2446 |
# File 'lib/lib_discord/client.rb', line 2440 def get_guild_onboarding(guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/onboarding"), headers: auditlog(reason) ) end |
#get_guild_preview(guild_id, reason: nil) ⇒ Response
1751 1752 1753 1754 1755 1756 1757 |
# File 'lib/lib_discord/client.rb', line 1751 def get_guild_preview(guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/preview"), headers: auditlog(reason) ) end |
#get_guild_prune_count(guild_id, query = {}, reason: nil) ⇒ Response
2235 2236 2237 2238 2239 2240 2241 2242 |
# File 'lib/lib_discord/client.rb', line 2235 def get_guild_prune_count(guild_id, query = {}, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/prune"), query:, headers: auditlog(reason) ) end |
#get_guild_role(guild_id, role_id, reason: nil) ⇒ Response
2134 2135 2136 2137 2138 2139 2140 |
# File 'lib/lib_discord/client.rb', line 2134 def get_guild_role(guild_id, role_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/roles/#{role_id}"), headers: auditlog(reason) ) end |
#get_guild_roles(guild_id, reason: nil) ⇒ Response
2118 2119 2120 2121 2122 2123 2124 |
# File 'lib/lib_discord/client.rb', line 2118 def get_guild_roles(guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/roles"), headers: auditlog(reason) ) end |
#get_guild_scheduled_event(guild_id, guild_scheduled_event_id, query = {}, reason: nil) ⇒ Response
1528 1529 1530 1531 1532 1533 1534 1535 |
# File 'lib/lib_discord/client.rb', line 1528 def get_guild_scheduled_event(guild_id, guild_scheduled_event_id, query = {}, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/scheduled-events/#{guild_scheduled_event_id}"), query:, headers: auditlog(reason) ) end |
#get_guild_scheduled_event_users(guild_id, guild_scheduled_event_id, query = {}, reason: nil) ⇒ Response
1580 1581 1582 1583 1584 1585 1586 1587 |
# File 'lib/lib_discord/client.rb', line 1580 def get_guild_scheduled_event_users(guild_id, guild_scheduled_event_id, query = {}, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/scheduled-events/#{guild_scheduled_event_id}/users"), query:, headers: auditlog(reason) ) end |
#get_guild_soundboard_sound(guild_id, sound_id, reason: nil) ⇒ Response
3007 3008 3009 3010 3011 3012 3013 |
# File 'lib/lib_discord/client.rb', line 3007 def get_guild_soundboard_sound(guild_id, sound_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/soundboard-sounds/#{sound_id}"), headers: auditlog(reason) ) end |
#get_guild_sticker(guild_id, sticker_id, reason: nil) ⇒ Response
3204 3205 3206 3207 3208 3209 3210 |
# File 'lib/lib_discord/client.rb', line 3204 def get_guild_sticker(guild_id, sticker_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/stickers/#{sticker_id}"), headers: auditlog(reason) ) end |
#get_guild_template(template_code, reason: nil) ⇒ Response
1600 1601 1602 1603 1604 1605 1606 |
# File 'lib/lib_discord/client.rb', line 1600 def get_guild_template(template_code, reason: nil) json_request( :get, discord("/guilds/templates/#{template_code}"), headers: auditlog(reason) ) end |
#get_guild_templates(guild_id, reason: nil) ⇒ Response
1632 1633 1634 1635 1636 1637 1638 |
# File 'lib/lib_discord/client.rb', line 1632 def get_guild_templates(guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/templates"), headers: auditlog(reason) ) end |
#get_guild_vanity_url(guild_id, reason: nil) ⇒ Response
2376 2377 2378 2379 2380 2381 2382 |
# File 'lib/lib_discord/client.rb', line 2376 def get_guild_vanity_url(guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/vanity-url"), headers: auditlog(reason) ) end |
#get_guild_voice_regions(guild_id, reason: nil) ⇒ Response
2268 2269 2270 2271 2272 2273 2274 |
# File 'lib/lib_discord/client.rb', line 2268 def get_guild_voice_regions(guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/regions"), headers: auditlog(reason) ) end |
#get_guild_webhooks(guild_id, reason: nil) ⇒ Response
3599 3600 3601 3602 3603 3604 3605 |
# File 'lib/lib_discord/client.rb', line 3599 def get_guild_webhooks(guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/webhooks"), headers: auditlog(reason) ) end |
#get_guild_welcome_screen(guild_id, reason: nil) ⇒ Response
2408 2409 2410 2411 2412 2413 2414 |
# File 'lib/lib_discord/client.rb', line 2408 def get_guild_welcome_screen(guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/welcome-screen"), headers: auditlog(reason) ) end |
#get_guild_widget(guild_id, reason: nil) ⇒ Response
2361 2362 2363 2364 2365 2366 2367 |
# File 'lib/lib_discord/client.rb', line 2361 def (guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/widget.json"), headers: auditlog(reason) ) end |
#get_guild_widget_image(guild_id, query = {}, reason: nil) ⇒ Response
2392 2393 2394 2395 2396 2397 2398 2399 |
# File 'lib/lib_discord/client.rb', line 2392 def (guild_id, query = {}, reason: nil) net_request( :get, discord("/guilds/#{guild_id}/widget.png"), query:, headers: auditlog(reason) ) end |
#get_guild_widget_settings(guild_id, reason: nil) ⇒ Response
2329 2330 2331 2332 2333 2334 2335 |
# File 'lib/lib_discord/client.rb', line 2329 def (guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/widget"), headers: auditlog(reason) ) end |
#get_install_url(query = {}) ⇒ URI
Get the URL for installing an application.
3880 |
# File 'lib/lib_discord/client.rb', line 3880 def get_install_url(query = {}) = (query) |
#get_invite(invite_code, query = {}, reason: nil) ⇒ Response
2494 2495 2496 2497 2498 2499 2500 2501 |
# File 'lib/lib_discord/client.rb', line 2494 def get_invite(invite_code, query = {}, reason: nil) json_request( :get, discord("/invites/#{invite_code}"), query:, headers: auditlog(reason) ) end |
#get_lobby(lobby_id, reason: nil) ⇒ Response
2545 2546 2547 2548 2549 2550 2551 |
# File 'lib/lib_discord/client.rb', line 2545 def get_lobby(lobby_id, reason: nil) json_request( :get, discord("/lobbies/#{lobby_id}"), headers: auditlog(reason) ) end |
#get_original_interaction_response(application_id, interaction_token, reason: nil) ⇒ Response
181 182 183 184 185 186 187 |
# File 'lib/lib_discord/client.rb', line 181 def get_original_interaction_response(application_id, interaction_token, reason: nil) json_request( :get, discord("/webhooks/#{application_id}/#{interaction_token}/messages/@original"), headers: auditlog(reason) ) end |
#get_pinned_messages(channel_id, reason: nil) ⇒ Response
956 957 958 959 960 961 962 |
# File 'lib/lib_discord/client.rb', line 956 def (channel_id, reason: nil) json_request( :get, discord("/channels/#{channel_id}/pins"), headers: auditlog(reason) ) end |
#get_reactions(channel_id, message_id, emoji, query = {}, reason: nil) ⇒ Response
2798 2799 2800 2801 2802 2803 2804 2805 |
# File 'lib/lib_discord/client.rb', line 2798 def get_reactions(channel_id, , emoji, query = {}, reason: nil) json_request( :get, discord("/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}"), query:, headers: auditlog(reason) ) end |
#get_sku_subscription(sku_id, subscription_id, reason: nil) ⇒ Response
3292 3293 3294 3295 3296 3297 3298 |
# File 'lib/lib_discord/client.rb', line 3292 def get_sku_subscription(sku_id, subscription_id, reason: nil) json_request( :get, discord("/skus/#{sku_id}/subscriptions/#{subscription_id}"), headers: auditlog(reason) ) end |
#get_stage_instance(channel_id, reason: nil) ⇒ Response
3093 3094 3095 3096 3097 3098 3099 |
# File 'lib/lib_discord/client.rb', line 3093 def get_stage_instance(channel_id, reason: nil) json_request( :get, discord("/stage-instances/#{channel_id}"), headers: auditlog(reason) ) end |
#get_sticker(sticker_id, reason: nil) ⇒ Response
3144 3145 3146 3147 3148 3149 3150 |
# File 'lib/lib_discord/client.rb', line 3144 def get_sticker(sticker_id, reason: nil) json_request( :get, discord("/stickers/#{sticker_id}"), headers: auditlog(reason) ) end |
#get_sticker_pack(pack_id, reason: nil) ⇒ Response
3173 3174 3175 3176 3177 3178 3179 |
# File 'lib/lib_discord/client.rb', line 3173 def get_sticker_pack(pack_id, reason: nil) json_request( :get, discord("/sticker-packs/#{pack_id}"), headers: auditlog(reason) ) end |
#get_thread_member(channel_id, user_id, query = {}, reason: nil) ⇒ Response
1153 1154 1155 1156 1157 1158 1159 1160 |
# File 'lib/lib_discord/client.rb', line 1153 def get_thread_member(channel_id, user_id, query = {}, reason: nil) json_request( :get, discord("/channels/#{channel_id}/thread-members/#{user_id}"), query:, headers: auditlog(reason) ) end |
#get_user(user_id, reason: nil) ⇒ Response
3324 3325 3326 3327 3328 3329 3330 |
# File 'lib/lib_discord/client.rb', line 3324 def get_user(user_id, reason: nil) json_request( :get, discord("/users/#{user_id}"), headers: auditlog(reason) ) end |
#get_user_voice_state(guild_id, user_id, reason: nil) ⇒ Response
3513 3514 3515 3516 3517 3518 3519 |
# File 'lib/lib_discord/client.rb', line 3513 def get_user_voice_state(guild_id, user_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/voice-states/#{user_id}"), headers: auditlog(reason) ) end |
#get_webhook(webhook_id, reason: nil) ⇒ Response
3614 3615 3616 3617 3618 3619 3620 |
# File 'lib/lib_discord/client.rb', line 3614 def get_webhook(webhook_id, reason: nil) json_request( :get, discord("/webhooks/#{webhook_id}"), headers: auditlog(reason) ) end |
#get_webhook_message(webhook_id, webhook_token, message_id, query = {}, reason: nil) ⇒ Response
3770 3771 3772 3773 3774 3775 3776 3777 |
# File 'lib/lib_discord/client.rb', line 3770 def (webhook_id, webhook_token, , query = {}, reason: nil) json_request( :get, discord("/webhooks/#{webhook_id}/#{webhook_token}/messages/#{message_id}"), query:, headers: auditlog(reason) ) end |
#get_webhook_with_token(webhook_id, webhook_token, reason: nil) ⇒ Response
3630 3631 3632 3633 3634 3635 3636 |
# File 'lib/lib_discord/client.rb', line 3630 def get_webhook_with_token(webhook_id, webhook_token, reason: nil) json_request( :get, discord("/webhooks/#{webhook_id}/#{webhook_token}"), headers: auditlog(reason) ) end |
#group_dm_add_recipient(channel_id, user_id, body, reason: nil) ⇒ Response
1005 1006 1007 1008 1009 1010 1011 1012 |
# File 'lib/lib_discord/client.rb', line 1005 def group_dm_add_recipient(channel_id, user_id, body, reason: nil) json_request( :put, discord("/channels/#{channel_id}/recipients/#{user_id}"), body:, headers: auditlog(reason) ) end |
#group_dm_remove_recipient(channel_id, user_id, reason: nil) ⇒ Response
1022 1023 1024 1025 1026 1027 1028 |
# File 'lib/lib_discord/client.rb', line 1022 def group_dm_remove_recipient(channel_id, user_id, reason: nil) json_request( :delete, discord("/channels/#{channel_id}/recipients/#{user_id}"), headers: auditlog(reason) ) end |
#join_thread(channel_id, reason: nil) ⇒ Response
1089 1090 1091 1092 1093 1094 1095 |
# File 'lib/lib_discord/client.rb', line 1089 def join_thread(channel_id, reason: nil) json_request( :put, discord("/channels/#{channel_id}/thread-members/@me"), headers: auditlog(reason) ) end |
#leave_guild(guild_id, reason: nil) ⇒ Response
3386 3387 3388 3389 3390 3391 3392 |
# File 'lib/lib_discord/client.rb', line 3386 def leave_guild(guild_id, reason: nil) json_request( :delete, discord("/users/@me/guilds/#{guild_id}"), headers: auditlog(reason) ) end |
#leave_lobby(lobby_id, reason: nil) ⇒ Response
2626 2627 2628 2629 2630 2631 2632 |
# File 'lib/lib_discord/client.rb', line 2626 def leave_lobby(lobby_id, reason: nil) json_request( :delete, discord("/lobbies/#{lobby_id}/members/@me"), headers: auditlog(reason) ) end |
#leave_thread(channel_id, reason: nil) ⇒ Response
1120 1121 1122 1123 1124 1125 1126 |
# File 'lib/lib_discord/client.rb', line 1120 def leave_thread(channel_id, reason: nil) json_request( :delete, discord("/channels/#{channel_id}/thread-members/@me"), headers: auditlog(reason) ) end |
#link_channel_to_lobby(lobby_id, body, reason: nil) ⇒ Response
2642 2643 2644 2645 2646 2647 2648 2649 |
# File 'lib/lib_discord/client.rb', line 2642 def link_channel_to_lobby(lobby_id, body, reason: nil) json_request( :patch, discord("/lobbies/#{lobby_id}/channel-linking"), body:, headers: auditlog(reason) ) end |
#list_active_guild_threads(guild_id, reason: nil) ⇒ Response
1847 1848 1849 1850 1851 1852 1853 |
# File 'lib/lib_discord/client.rb', line 1847 def list_active_guild_threads(guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/threads/active"), headers: auditlog(reason) ) end |
#list_application_emojis(application_id, reason: nil) ⇒ Response
1323 1324 1325 1326 1327 1328 1329 |
# File 'lib/lib_discord/client.rb', line 1323 def list_application_emojis(application_id, reason: nil) json_request( :get, discord("/applications/#{application_id}/emojis"), headers: auditlog(reason) ) end |
#list_auto_moderation_rules_for_guild(guild_id, reason: nil) ⇒ Response
723 724 725 726 727 728 729 |
# File 'lib/lib_discord/client.rb', line 723 def list_auto_moderation_rules_for_guild(guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/auto-moderation/rules"), headers: auditlog(reason) ) end |
#list_default_soundboard_sounds(reason: nil) ⇒ Response
2976 2977 2978 2979 2980 2981 2982 |
# File 'lib/lib_discord/client.rb', line 2976 def list_default_soundboard_sounds(reason: nil) json_request( :get, discord("/soundboard-default-sounds"), headers: auditlog(reason) ) end |
#list_entitlements(application_id, reason: nil) ⇒ Response
1409 1410 1411 1412 1413 1414 1415 |
# File 'lib/lib_discord/client.rb', line 1409 def list_entitlements(application_id, reason: nil) json_request( :get, discord("/applications/#{application_id}/entitlements"), headers: auditlog(reason) ) end |
#list_guild_emojis(guild_id, reason: nil) ⇒ Response
1241 1242 1243 1244 1245 1246 1247 |
# File 'lib/lib_discord/client.rb', line 1241 def list_guild_emojis(guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/emojis"), headers: auditlog(reason) ) end |
#list_guild_members(guild_id, query = {}, reason: nil) ⇒ Response
1879 1880 1881 1882 1883 1884 1885 1886 |
# File 'lib/lib_discord/client.rb', line 1879 def list_guild_members(guild_id, query = {}, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/members"), query:, headers: auditlog(reason) ) end |
#list_guild_soundboard_sounds(guild_id, reason: nil) ⇒ Response
2991 2992 2993 2994 2995 2996 2997 |
# File 'lib/lib_discord/client.rb', line 2991 def list_guild_soundboard_sounds(guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/soundboard-sounds"), headers: auditlog(reason) ) end |
#list_guild_stickers(guild_id, reason: nil) ⇒ Response
3188 3189 3190 3191 3192 3193 3194 |
# File 'lib/lib_discord/client.rb', line 3188 def list_guild_stickers(guild_id, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/stickers"), headers: auditlog(reason) ) end |
#list_joined_private_archived_threads(channel_id, query = {}, reason: nil) ⇒ Response
1221 1222 1223 1224 1225 1226 1227 1228 |
# File 'lib/lib_discord/client.rb', line 1221 def list_joined_private_archived_threads(channel_id, query = {}, reason: nil) json_request( :get, discord("/channels/#{channel_id}/users/@me/threads/archived/private"), query:, headers: auditlog(reason) ) end |
#list_private_archived_threads(channel_id, query = {}, reason: nil) ⇒ Response
1204 1205 1206 1207 1208 1209 1210 1211 |
# File 'lib/lib_discord/client.rb', line 1204 def list_private_archived_threads(channel_id, query = {}, reason: nil) json_request( :get, discord("/channels/#{channel_id}/threads/archived/private"), query:, headers: auditlog(reason) ) end |
#list_public_archived_threads(channel_id, query = {}, reason: nil) ⇒ Response
1187 1188 1189 1190 1191 1192 1193 1194 |
# File 'lib/lib_discord/client.rb', line 1187 def list_public_archived_threads(channel_id, query = {}, reason: nil) json_request( :get, discord("/channels/#{channel_id}/threads/archived/public"), query:, headers: auditlog(reason) ) end |
#list_scheduled_events_for_guild(guild_id, query = {}, reason: nil) ⇒ Response
1493 1494 1495 1496 1497 1498 1499 1500 |
# File 'lib/lib_discord/client.rb', line 1493 def list_scheduled_events_for_guild(guild_id, query = {}, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/scheduled-events"), query:, headers: auditlog(reason) ) end |
#list_sku_subscriptions(sku_id, query = {}, reason: nil) ⇒ Response
3275 3276 3277 3278 3279 3280 3281 3282 |
# File 'lib/lib_discord/client.rb', line 3275 def list_sku_subscriptions(sku_id, query = {}, reason: nil) json_request( :get, discord("/skus/#{sku_id}/subscriptions"), query:, headers: auditlog(reason) ) end |
#list_skus(application_id, reason: nil) ⇒ Response
2941 2942 2943 2944 2945 2946 2947 |
# File 'lib/lib_discord/client.rb', line 2941 def list_skus(application_id, reason: nil) json_request( :get, discord("/applications/#{application_id}/skus"), headers: auditlog(reason) ) end |
#list_sticker_packs(reason: nil) ⇒ Response
3158 3159 3160 3161 3162 3163 3164 |
# File 'lib/lib_discord/client.rb', line 3158 def list_sticker_packs(reason: nil) json_request( :get, discord("/sticker-packs"), headers: auditlog(reason) ) end |
#list_thread_members(channel_id, query = {}, reason: nil) ⇒ Response
1170 1171 1172 1173 1174 1175 1176 1177 |
# File 'lib/lib_discord/client.rb', line 1170 def list_thread_members(channel_id, query = {}, reason: nil) json_request( :get, discord("/channels/#{channel_id}/thread-members"), query:, headers: auditlog(reason) ) end |
#list_voice_regions(reason: nil) ⇒ Response
3482 3483 3484 3485 3486 3487 3488 |
# File 'lib/lib_discord/client.rb', line 3482 def list_voice_regions(reason: nil) json_request( :get, discord("/voice/regions"), headers: auditlog(reason) ) end |
#modify_application_emoji(application_id, emoji_id, body, reason: nil) ⇒ Response
1373 1374 1375 1376 1377 1378 1379 1380 |
# File 'lib/lib_discord/client.rb', line 1373 def modify_application_emoji(application_id, emoji_id, body, reason: nil) json_request( :patch, discord("/applications/#{application_id}/emojis/#{emoji_id}"), body:, headers: auditlog(reason) ) end |
#modify_auto_moderation_rule(guild_id, auto_moderation_rule_id, body, reason: nil) ⇒ Response
773 774 775 776 777 778 779 780 |
# File 'lib/lib_discord/client.rb', line 773 def modify_auto_moderation_rule(guild_id, auto_moderation_rule_id, body, reason: nil) json_request( :patch, discord("/guilds/#{guild_id}/auto-moderation/rules/#{auto_moderation_rule_id}"), body:, headers: auditlog(reason) ) end |
#modify_channel(channel_id, body, reason: nil) ⇒ Response
825 826 827 828 829 830 831 832 |
# File 'lib/lib_discord/client.rb', line 825 def modify_channel(channel_id, body, reason: nil) json_request( :patch, discord("/channels/#{channel_id}"), body:, headers: auditlog(reason) ) end |
#modify_current_member(guild_id, body, reason: nil) ⇒ Response
1949 1950 1951 1952 1953 1954 1955 1956 |
# File 'lib/lib_discord/client.rb', line 1949 def modify_current_member(guild_id, body, reason: nil) json_request( :patch, discord("/guilds/#{guild_id}/members/@me"), body:, headers: auditlog(reason) ) end |
#modify_current_user(body, reason: nil) ⇒ Response
3339 3340 3341 3342 3343 3344 3345 3346 |
# File 'lib/lib_discord/client.rb', line 3339 def modify_current_user(body, reason: nil) json_request( :patch, discord("/users/@me"), body:, headers: auditlog(reason) ) end |
#modify_current_user_nick(guild_id, body, reason: nil) ⇒ Response
Use #modify_current_member instead.
1968 1969 1970 1971 1972 1973 1974 1975 |
# File 'lib/lib_discord/client.rb', line 1968 def modify_current_user_nick(guild_id, body, reason: nil) json_request( :patch, discord("/guilds/#{guild_id}/members/@me/nick"), body:, headers: auditlog(reason) ) end |
#modify_current_user_voice_state(guild_id, body, reason: nil) ⇒ Response
3529 3530 3531 3532 3533 3534 3535 3536 |
# File 'lib/lib_discord/client.rb', line 3529 def modify_current_user_voice_state(guild_id, body, reason: nil) json_request( :patch, discord("/guilds/#{guild_id}/voice-states/@me"), body:, headers: auditlog(reason) ) end |
#modify_guild(guild_id, body, reason: nil) ⇒ Response
1767 1768 1769 1770 1771 1772 1773 1774 |
# File 'lib/lib_discord/client.rb', line 1767 def modify_guild(guild_id, body, reason: nil) json_request( :patch, discord("/guilds/#{guild_id}"), body:, headers: auditlog(reason) ) end |
#modify_guild_channel_positions(guild_id, body, reason: nil) ⇒ Response
1831 1832 1833 1834 1835 1836 1837 1838 |
# File 'lib/lib_discord/client.rb', line 1831 def modify_guild_channel_positions(guild_id, body, reason: nil) json_request( :patch, discord("/guilds/#{guild_id}/channels"), body:, headers: auditlog(reason) ) end |
#modify_guild_emoji(guild_id, emoji_id, body, reason: nil) ⇒ Response
1291 1292 1293 1294 1295 1296 1297 1298 |
# File 'lib/lib_discord/client.rb', line 1291 def modify_guild_emoji(guild_id, emoji_id, body, reason: nil) json_request( :patch, discord("/guilds/#{guild_id}/emojis/#{emoji_id}"), body:, headers: auditlog(reason) ) end |
#modify_guild_incident_actions(guild_id, body, reason: nil) ⇒ Response
2473 2474 2475 2476 2477 2478 2479 2480 |
# File 'lib/lib_discord/client.rb', line 2473 def modify_guild_incident_actions(guild_id, body, reason: nil) json_request( :put, discord("/guilds/#{guild_id}/incident-actions"), body:, headers: auditlog(reason) ) end |
#modify_guild_member(guild_id, user_id, body, reason: nil) ⇒ Response
1932 1933 1934 1935 1936 1937 1938 1939 |
# File 'lib/lib_discord/client.rb', line 1932 def modify_guild_member(guild_id, user_id, body, reason: nil) json_request( :patch, discord("/guilds/#{guild_id}/members/#{user_id}"), body:, headers: auditlog(reason) ) end |
#modify_guild_mfa_level(guild_id, body, reason: nil) ⇒ Response
2202 2203 2204 2205 2206 2207 2208 2209 |
# File 'lib/lib_discord/client.rb', line 2202 def modify_guild_mfa_level(guild_id, body, reason: nil) json_request( :post, discord("/guilds/#{guild_id}/mfa"), body:, headers: auditlog(reason) ) end |
#modify_guild_onboarding(guild_id, body, reason: nil) ⇒ Response
2456 2457 2458 2459 2460 2461 2462 2463 |
# File 'lib/lib_discord/client.rb', line 2456 def modify_guild_onboarding(guild_id, body, reason: nil) json_request( :put, discord("/guilds/#{guild_id}/onboarding"), body:, headers: auditlog(reason) ) end |
#modify_guild_role(guild_id, role_id, body, reason: nil) ⇒ Response
2185 2186 2187 2188 2189 2190 2191 2192 |
# File 'lib/lib_discord/client.rb', line 2185 def modify_guild_role(guild_id, role_id, body, reason: nil) json_request( :patch, discord("/guilds/#{guild_id}/roles/#{role_id}"), body:, headers: auditlog(reason) ) end |
#modify_guild_role_positions(guild_id, body, reason: nil) ⇒ Response
2167 2168 2169 2170 2171 2172 2173 2174 |
# File 'lib/lib_discord/client.rb', line 2167 def modify_guild_role_positions(guild_id, body, reason: nil) json_request( :patch, discord("/guilds/#{guild_id}/roles"), body:, headers: auditlog(reason) ) end |
#modify_guild_scheduled_event(guild_id, guild_scheduled_event_id, body, reason: nil) ⇒ Response
1546 1547 1548 1549 1550 1551 1552 1553 |
# File 'lib/lib_discord/client.rb', line 1546 def modify_guild_scheduled_event(guild_id, guild_scheduled_event_id, body, reason: nil) json_request( :patch, discord("/guilds/#{guild_id}/scheduled-events/#{guild_scheduled_event_id}"), body:, headers: auditlog(reason) ) end |
#modify_guild_soundboard_sound(guild_id, sound_id, body, reason: nil) ⇒ Response
3041 3042 3043 3044 3045 3046 3047 3048 |
# File 'lib/lib_discord/client.rb', line 3041 def modify_guild_soundboard_sound(guild_id, sound_id, body, reason: nil) json_request( :patch, discord("/guilds/#{guild_id}/soundboard-sounds/#{sound_id}"), body:, headers: auditlog(reason) ) end |
#modify_guild_sticker(guild_id, sticker_id, body, reason: nil) ⇒ Response
3238 3239 3240 3241 3242 3243 3244 3245 |
# File 'lib/lib_discord/client.rb', line 3238 def modify_guild_sticker(guild_id, sticker_id, body, reason: nil) json_request( :patch, discord("/guilds/#{guild_id}/stickers/#{sticker_id}"), body:, headers: auditlog(reason) ) end |
#modify_guild_template(guild_id, template_code, body, reason: nil) ⇒ Response
1682 1683 1684 1685 1686 1687 1688 1689 |
# File 'lib/lib_discord/client.rb', line 1682 def modify_guild_template(guild_id, template_code, body, reason: nil) json_request( :patch, discord("/guilds/#{guild_id}/templates/#{template_code}"), body:, headers: auditlog(reason) ) end |
#modify_guild_welcome_screen(guild_id, body, reason: nil) ⇒ Response
2424 2425 2426 2427 2428 2429 2430 2431 |
# File 'lib/lib_discord/client.rb', line 2424 def modify_guild_welcome_screen(guild_id, body, reason: nil) json_request( :patch, discord("/guilds/#{guild_id}/welcome-screen"), body:, headers: auditlog(reason) ) end |
#modify_guild_widget(guild_id, body, reason: nil) ⇒ Response
2345 2346 2347 2348 2349 2350 2351 2352 |
# File 'lib/lib_discord/client.rb', line 2345 def (guild_id, body, reason: nil) json_request( :patch, discord("/guilds/#{guild_id}/widget"), body:, headers: auditlog(reason) ) end |
#modify_lobby(lobby_id, body, reason: nil) ⇒ Response
2561 2562 2563 2564 2565 2566 2567 2568 |
# File 'lib/lib_discord/client.rb', line 2561 def modify_lobby(lobby_id, body, reason: nil) json_request( :patch, discord("/lobbies/#{lobby_id}"), body:, headers: auditlog(reason) ) end |
#modify_stage_instance(channel_id, body, reason: nil) ⇒ Response
3109 3110 3111 3112 3113 3114 3115 3116 |
# File 'lib/lib_discord/client.rb', line 3109 def modify_stage_instance(channel_id, body, reason: nil) json_request( :patch, discord("/stage-instances/#{channel_id}"), body:, headers: auditlog(reason) ) end |
#modify_user_voice_state(guild_id, user_id, body, reason: nil) ⇒ Response
3547 3548 3549 3550 3551 3552 3553 3554 |
# File 'lib/lib_discord/client.rb', line 3547 def modify_user_voice_state(guild_id, user_id, body, reason: nil) json_request( :patch, discord("/guilds/#{guild_id}/voice-states/#{user_id}"), body:, headers: auditlog(reason) ) end |
#modify_webhook(webhook_id, body, reason: nil) ⇒ Response
3646 3647 3648 3649 3650 3651 3652 3653 |
# File 'lib/lib_discord/client.rb', line 3646 def modify_webhook(webhook_id, body, reason: nil) json_request( :patch, discord("/webhooks/#{webhook_id}"), body:, headers: auditlog(reason) ) end |
#modify_webhook_with_token(webhook_id, webhook_token, body, reason: nil) ⇒ Response
3664 3665 3666 3667 3668 3669 3670 3671 |
# File 'lib/lib_discord/client.rb', line 3664 def modify_webhook_with_token(webhook_id, webhook_token, body, reason: nil) json_request( :patch, discord("/webhooks/#{webhook_id}/#{webhook_token}"), body:, headers: auditlog(reason) ) end |
#oauth2_request_token(user, pass, query) ⇒ Response
3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 |
# File 'lib/lib_discord/client.rb', line 3826 def oauth2_request_token(user, pass, query) net_request( :post, discord("/oauth2/token"), body: URI.encode_www_form(query), headers: { "Authorization" => "Basic " + base64_strictencode("#{user}:#{pass}"), "Content-Type" => "application/x-www-form-urlencoded" } ) end |
#oauth2_revoke_token(user, pass, query) ⇒ Response
3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 |
# File 'lib/lib_discord/client.rb', line 3846 def oauth2_revoke_token(user, pass, query) net_request( :post, discord("/oauth2/token/revoke"), body: URI.encode_www_form(query), headers: { "Authorization" => "Basic " + base64_strictencode("#{user}:#{pass}"), "Content-Type" => "application/x-www-form-urlencoded" } ) end |
#pin_message(channel_id, message_id, reason: nil) ⇒ Response
972 973 974 975 976 977 978 |
# File 'lib/lib_discord/client.rb', line 972 def (channel_id, , reason: nil) json_request( :put, discord("/channels/#{channel_id}/pins/#{message_id}"), headers: auditlog(reason) ) end |
#remove_guild_ban(guild_id, user_id, reason: nil) ⇒ Response
2086 2087 2088 2089 2090 2091 2092 |
# File 'lib/lib_discord/client.rb', line 2086 def remove_guild_ban(guild_id, user_id, reason: nil) json_request( :delete, discord("/guilds/#{guild_id}/bans/#{user_id}"), headers: auditlog(reason) ) end |
#remove_guild_member(guild_id, user_id, reason: nil) ⇒ Response
2019 2020 2021 2022 2023 2024 2025 |
# File 'lib/lib_discord/client.rb', line 2019 def remove_guild_member(guild_id, user_id, reason: nil) json_request( :delete, discord("/guilds/#{guild_id}/members/#{user_id}"), headers: auditlog(reason) ) end |
#remove_guild_member_role(guild_id, user_id, role_id, reason: nil) ⇒ Response
2003 2004 2005 2006 2007 2008 2009 |
# File 'lib/lib_discord/client.rb', line 2003 def remove_guild_member_role(guild_id, user_id, role_id, reason: nil) json_request( :delete, discord("/guilds/#{guild_id}/members/#{user_id}/roles/#{role_id}"), headers: auditlog(reason) ) end |
#remove_member_from_lobby(lobby_id, user_id, reason: nil) ⇒ Response
2611 2612 2613 2614 2615 2616 2617 |
# File 'lib/lib_discord/client.rb', line 2611 def remove_member_from_lobby(lobby_id, user_id, reason: nil) json_request( :delete, discord("/lobbies/#{lobby_id}/members/#{user_id}"), headers: auditlog(reason) ) end |
#remove_thread_member(channel_id, user_id, reason: nil) ⇒ Response
1136 1137 1138 1139 1140 1141 1142 |
# File 'lib/lib_discord/client.rb', line 1136 def remove_thread_member(channel_id, user_id, reason: nil) json_request( :delete, discord("/channels/#{channel_id}/thread-members/#{user_id}"), headers: auditlog(reason) ) end |
#search_guild_members(guild_id, query = {}, reason: nil) ⇒ Response
1896 1897 1898 1899 1900 1901 1902 1903 |
# File 'lib/lib_discord/client.rb', line 1896 def search_guild_members(guild_id, query = {}, reason: nil) json_request( :get, discord("/guilds/#{guild_id}/members/search"), query:, headers: auditlog(reason) ) end |
#send_soundboard_sound(channel_id, body, reason: nil) ⇒ Response
2961 2962 2963 2964 2965 2966 2967 2968 |
# File 'lib/lib_discord/client.rb', line 2961 def send_soundboard_sound(channel_id, body, reason: nil) json_request( :post, discord("/channels/#{channel_id}/send-soundboard-sound"), body:, headers: auditlog(reason) ) end |
#start_thread_from_message(channel_id, message_id, body, reason: nil) ⇒ Response
1039 1040 1041 1042 1043 1044 1045 1046 |
# File 'lib/lib_discord/client.rb', line 1039 def (channel_id, , body, reason: nil) json_request( :post, discord("/channels/#{channel_id}/messages/#{message_id}/threads"), body:, headers: auditlog(reason) ) end |
#start_thread_in_forum_or_media_channel(channel_id, body, reason: nil) ⇒ Response
1073 1074 1075 1076 1077 1078 1079 1080 |
# File 'lib/lib_discord/client.rb', line 1073 def start_thread_in_forum_or_media_channel(channel_id, body, reason: nil) json_request( :post, discord("/channels/#{channel_id}/threads"), body:, headers: auditlog(reason) ) end |
#start_thread_without_message(channel_id, body, reason: nil) ⇒ Response
1056 1057 1058 1059 1060 1061 1062 1063 |
# File 'lib/lib_discord/client.rb', line 1056 def (channel_id, body, reason: nil) json_request( :post, discord("/channels/#{channel_id}/threads"), body:, headers: auditlog(reason) ) end |
#sync_guild_template(guild_id, template_code, reason: nil) ⇒ Response
1665 1666 1667 1668 1669 1670 1671 |
# File 'lib/lib_discord/client.rb', line 1665 def sync_guild_template(guild_id, template_code, reason: nil) json_request( :put, discord("/guilds/#{guild_id}/templates/#{template_code}"), headers: auditlog(reason) ) end |
#trigger_typing_indicator(channel_id, reason: nil) ⇒ Response
941 942 943 944 945 946 947 |
# File 'lib/lib_discord/client.rb', line 941 def trigger_typing_indicator(channel_id, reason: nil) json_request( :post, discord("/channels/#{channel_id}/typing"), headers: auditlog(reason) ) end |
#unlink_channel_from_lobby(lobby_id, reason: nil) ⇒ Response
2658 2659 2660 2661 2662 2663 2664 |
# File 'lib/lib_discord/client.rb', line 2658 def unlink_channel_from_lobby(lobby_id, reason: nil) json_request( :patch, discord("/lobbies/#{lobby_id}/channel-linking"), headers: auditlog(reason) ) end |
#unpin_message(channel_id, message_id, reason: nil) ⇒ Response
988 989 990 991 992 993 994 |
# File 'lib/lib_discord/client.rb', line 988 def (channel_id, , reason: nil) json_request( :delete, discord("/channels/#{channel_id}/pins/#{message_id}"), headers: auditlog(reason) ) end |
#update_application_role_connection_metadata_records(application_id, body, reason: nil) ⇒ Response
636 637 638 639 640 641 642 643 |
# File 'lib/lib_discord/client.rb', line 636 def (application_id, body, reason: nil) json_request( :put, discord("/applications/#{application_id}/role-connections/metadata"), body:, headers: auditlog(reason) ) end |
#update_current_user_application_role_connection(application_id, body, reason: nil) ⇒ Response
3463 3464 3465 3466 3467 3468 3469 3470 |
# File 'lib/lib_discord/client.rb', line 3463 def update_current_user_application_role_connection(application_id, body, reason: nil) json_request( :put, discord("/users/@me/applications/#{application_id}/role-connection"), body:, headers: auditlog(reason) ) end |