Class: Discordrb::Events::ChannelRecipientEvent
- Defined in:
- lib/discordrb/events/channels.rb
Overview
Generic subclass for recipient events (add/remove)
Direct Known Subclasses
Instance Attribute Summary collapse
-
#channel ⇒ Channel
readonly
The channel in question.
-
#recipient ⇒ Recipient
readonly
The recipient that was added/removed from the group.
Attributes inherited from Event
Instance Method Summary collapse
-
#initialize(data, bot) ⇒ ChannelRecipientEvent
constructor
A new instance of ChannelRecipientEvent.
Constructor Details
#initialize(data, bot) ⇒ ChannelRecipientEvent
Returns a new instance of ChannelRecipientEvent.
137 138 139 140 141 142 143 144 |
# File 'lib/discordrb/events/channels.rb', line 137 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
#channel ⇒ Channel (readonly)
Returns the channel in question.
128 129 130 |
# File 'lib/discordrb/events/channels.rb', line 128 def channel @channel end |
#recipient ⇒ Recipient (readonly)
Returns the recipient that was added/removed from the group.
133 134 135 |
# File 'lib/discordrb/events/channels.rb', line 133 def recipient @recipient end |