Class: RubyCord::Guild::URLWebhook

Inherits:
Webhook
  • Object
show all
Defined in:
lib/rubycord/guild/webhook/url_webhook.rb

Instance Attribute Summary collapse

Attributes inherited from Webhook

#application_id, #avatar, #channel_id, #guild_id, #name, #token, #user

Instance Method Summary collapse

Methods inherited from Webhook

#delete, #delete_message, #edit, #edit_message, from_url, #inspect, #post

Constructor Details

#initialize(url, client: nil) ⇒ URLWebhook

Initializes the webhook from URL.

Parameters:

  • url (String)

    The URL of the webhook.

  • client (RubyCord::Client) (defaults to: nil)

    The client to associate with the webhook.



16
17
18
19
20
# File 'lib/rubycord/guild/webhook/url_webhook.rb', line 16

def initialize(url, client: nil)
  @url = url
  @token = ""
  @http = RubyCord::Client::HTTP.new(client || RubyCord::Client.new)
end

Instance Attribute Details

#urlString (readonly)

Returns The URL of the webhook.

Returns:

  • (String)

    The URL of the webhook.



8
9
10
# File 'lib/rubycord/guild/webhook/url_webhook.rb', line 8

def url
  @url
end