Class: Rubycord::Events::WebhookUpdateEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/rubycord/events/webhooks.rb

Overview

Event raised when a webhook is updated

Instance Attribute Summary collapse

Attributes inherited from Event

#bot

Instance Method Summary collapse

Constructor Details

#initialize(data, bot) ⇒ WebhookUpdateEvent

Returns a new instance of WebhookUpdateEvent.



13
14
15
16
17
18
# File 'lib/rubycord/events/webhooks.rb', line 13

def initialize(data, bot)
  @bot = bot

  @server = bot.server(data["guild_id"].to_i)
  @channel = bot.channel(data["channel_id"].to_i)
end

Instance Attribute Details

#channelChannel (readonly)

Returns the channel the webhook is associated to.

Returns:

  • (Channel)

    the channel the webhook is associated to



11
12
13
# File 'lib/rubycord/events/webhooks.rb', line 11

def channel
  @channel
end

#serverServer (readonly)

Returns the server where the webhook updated.

Returns:

  • (Server)

    the server where the webhook updated



8
9
10
# File 'lib/rubycord/events/webhooks.rb', line 8

def server
  @server
end