Class: LibDiscord::Interaction

Inherits:
Resource
  • Object
show all
Defined in:
lib/lib_discord/interaction.rb

Overview

Interactions

Do not instantiate an Interaction directly. Instead request one from an instance fo Client.

client = LibDiscord::Client.new("Bot auth.token")
i = client["interaction"]

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from LibDiscord::Resource

Instance Method Details

#create_followup_message(application_id:, interaction_token:, json:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



100
101
102
# File 'lib/lib_discord/interaction.rb', line 100

def create_followup_message(application_id:, interaction_token:, json:)
  send_request(:post, "/webhooks/#{application_id}/#{interaction_token}", json:)
end

#create_interaction_response(interaction_id:, interaction_token:, json:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



32
33
34
# File 'lib/lib_discord/interaction.rb', line 32

def create_interaction_response(interaction_id:, interaction_token:, json:)
  send_request(:post, "/interactions/#{interaction_id}/#{interaction_token}/callback", json:)
end

#delete_followup_message(application_id:, interaction_token:, message_id:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



159
160
161
# File 'lib/lib_discord/interaction.rb', line 159

def delete_followup_message(application_id:, interaction_token:, message_id:)
  send_request(:delete, "/webhooks/#{application_id}/#{interaction_token}/messages/#{message_id}")
end

#delete_original_interaction_response(application_id:, interaction_token:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



82
83
84
# File 'lib/lib_discord/interaction.rb', line 82

def delete_original_interaction_response(application_id:, interaction_token:)
  send_request(:delete, "/webhooks/#{application_id}/#{interaction_token}/messages/@original")
end

#edit_followup_message(application_id:, interaction_token:, message_id:, json:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



140
141
142
# File 'lib/lib_discord/interaction.rb', line 140

def edit_followup_message(application_id:, interaction_token:, message_id:, json:)
  send_request(:patch, "/webhooks/#{application_id}/#{interaction_token}/messages/#{message_id}", json:)
end

#edit_original_interaction_response(application_id:, interaction_token:, json:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



66
67
68
# File 'lib/lib_discord/interaction.rb', line 66

def edit_original_interaction_response(application_id:, interaction_token:, json:)
  send_request(:patch, "/webhooks/#{application_id}/#{interaction_token}/messages/@original", json:)
end

#get_followup_message(application_id:, interaction_token:, message_id:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



119
120
121
# File 'lib/lib_discord/interaction.rb', line 119

def get_followup_message(application_id:, interaction_token:, message_id:)
  send_request(:get, "/webhooks/#{application_id}/#{interaction_token}/messages/#{message_id}")
end

#get_original_interaction_response(application_id:, interaction_token:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



48
49
50
# File 'lib/lib_discord/interaction.rb', line 48

def get_original_interaction_response(application_id:, interaction_token:)
  send_request(:get, "/webhooks/#{application_id}/#{interaction_token}/messages/@original")
end