Class: Discorb::Webhook::URLWebhook

Inherits:
Discorb::Webhook show all
Defined in:
lib/discorb/webhook.rb

Overview

Represents a webhook from URL.

Instance Attribute Summary collapse

Attributes inherited from Discorb::Webhook

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

Instance Method Summary collapse

Methods inherited from Discorb::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 (Discorb::Client) (defaults to: nil)

    The client to associate with the webhook.



244
245
246
247
248
# File 'lib/discorb/webhook.rb', line 244

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

Instance Attribute Details

#url -> String (readonly)

Returns The URL of the webhook.

Returns:

  • (String)

    The URL of the webhook.



236
237
238
# File 'lib/discorb/webhook.rb', line 236

def url
  @url
end