Class: Discordrb::Events::ChannelPinsUpdateEvent
- Defined in:
- lib/discordrb/events/channels.rb
Overview
Raised when a message is pinned or unpinned.
Instance Attribute Summary collapse
-
#channel ⇒ Channel
readonly
The channel this event originates from.
-
#last_pin_timestamp ⇒ Time?
readonly
Time at which the most recent pinned message was pinned.
-
#server ⇒ Server?
readonly
The server this event originates from.
Attributes inherited from Event
Instance Method Summary collapse
-
#initialize(data, bot) ⇒ ChannelPinsUpdateEvent
constructor
A new instance of ChannelPinsUpdateEvent.
Constructor Details
#initialize(data, bot) ⇒ ChannelPinsUpdateEvent
Returns a new instance of ChannelPinsUpdateEvent.
182 183 184 185 186 187 188 |
# File 'lib/discordrb/events/channels.rb', line 182 def initialize(data, bot) @bot = bot @server = bot.server(data['guild_id']) if data['guild_id'] @channel = bot.channel(data['channel_id']) @last_pin_timestamp = Time.iso8601(data['last_pin_timestamp']) if data['last_pin_timestamp'] end |
Instance Attribute Details
#channel ⇒ Channel (readonly)
Returns The channel this event originates from.
177 178 179 |
# File 'lib/discordrb/events/channels.rb', line 177 def channel @channel end |
#last_pin_timestamp ⇒ Time? (readonly)
Returns Time at which the most recent pinned message was pinned.
174 175 176 |
# File 'lib/discordrb/events/channels.rb', line 174 def @last_pin_timestamp end |
#server ⇒ Server? (readonly)
Returns The server this event originates from.
180 181 182 |
# File 'lib/discordrb/events/channels.rb', line 180 def server @server end |