Class: Discordrb::Events::ChannelUpdateEvent

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

Overview

Raised when a channel is updated (e.g. topic changes)

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#channelObject (readonly)

Returns the value of attribute channel.



7
8
9
# File 'lib/discordrb/events/channel_update.rb', line 7

def channel
  @channel
end

#is_privateObject (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

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/discordrb/events/channel_update.rb', line 7

def name
  @name
end

#positionObject (readonly)

Returns the value of attribute position.



7
8
9
# File 'lib/discordrb/events/channel_update.rb', line 7

def position
  @position
end

#serverObject (readonly)

Returns the value of attribute server.



7
8
9
# File 'lib/discordrb/events/channel_update.rb', line 7

def server
  @server
end

#topicObject (readonly)

Returns the value of attribute topic.



7
8
9
# File 'lib/discordrb/events/channel_update.rb', line 7

def topic
  @topic
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/discordrb/events/channel_update.rb', line 7

def type
  @type
end