Class: Discordrb::Events::ChannelUpdateEvent
- Inherits:
-
Object
- Object
- Discordrb::Events::ChannelUpdateEvent
- Defined in:
- lib/discordrb/events/channel_update.rb
Overview
Raised when a channel is updated (e.g. topic changes)
Instance Attribute Summary collapse
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#is_private ⇒ Object
readonly
Returns the value of attribute is_private.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#topic ⇒ Object
readonly
Returns the value of attribute topic.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(data, bot) ⇒ ChannelUpdateEvent
constructor
A new instance of ChannelUpdateEvent.
Constructor Details
#initialize(data, bot) ⇒ ChannelUpdateEvent
Returns a new instance of ChannelUpdateEvent.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/discordrb/events/channel_update.rb', line 9 def initialize(data, bot) @type = data['type'] @topic = data['topic'] @position = data['position'] @name = data['name'] @is_private = data['is_private'] @server = bot.server(data['guild_id'].to_i) return unless @server @channel = bot.channel(data['id'].to_i) end |
Instance Attribute Details
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
7 8 9 |
# File 'lib/discordrb/events/channel_update.rb', line 7 def channel @channel end |
#is_private ⇒ Object (readonly)
Returns the value of attribute is_private.
7 8 9 |
# File 'lib/discordrb/events/channel_update.rb', line 7 def is_private @is_private end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/discordrb/events/channel_update.rb', line 7 def name @name end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
7 8 9 |
# File 'lib/discordrb/events/channel_update.rb', line 7 def position @position end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
7 8 9 |
# File 'lib/discordrb/events/channel_update.rb', line 7 def server @server end |
#topic ⇒ Object (readonly)
Returns the value of attribute topic.
7 8 9 |
# File 'lib/discordrb/events/channel_update.rb', line 7 def topic @topic end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/discordrb/events/channel_update.rb', line 7 def type @type end |