Class: Discordrb::Events::WebhookUpdateEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/discordrb/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.



15
16
17
18
19
20
# File 'lib/discordrb/events/webhooks.rb', line 15

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



13
14
15
# File 'lib/discordrb/events/webhooks.rb', line 13

def channel
  @channel
end

#serverServer (readonly)

Returns the server where the webhook updated.

Returns:

  • (Server)

    the server where the webhook updated



10
11
12
# File 'lib/discordrb/events/webhooks.rb', line 10

def server
  @server
end