Class: Discordrb::Events::ChannelRecipientEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/discordrb/events/channels.rb

Overview

Generic subclass for recipient events (add/remove)

Instance Attribute Summary collapse

Attributes inherited from Event

#bot

Instance Method Summary collapse

Constructor Details

#initialize(data, bot) ⇒ ChannelRecipientEvent


135
136
137
138
139
140
141
142
# File 'lib/discordrb/events/channels.rb', line 135

def initialize(data, bot)
  @bot = bot

  @channel = bot.channel(data['channel_id'].to_i)
  recipient = data['user']
  recipient_user = bot.ensure_user(recipient)
  @recipient = Discordrb::Recipient.new(recipient_user, @channel, bot)
end

Instance Attribute Details

#channelChannel (readonly)


128
129
130
# File 'lib/discordrb/events/channels.rb', line 128

def channel
  @channel
end

#recipientRecipient (readonly)


132
133
134
# File 'lib/discordrb/events/channels.rb', line 132

def recipient
  @recipient
end