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.



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/discordrb/events/channel_update.rb', line 15

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.



12
13
14
# File 'lib/discordrb/events/channel_update.rb', line 12

def channel
  @channel
end

#is_privateObject (readonly)

Returns the value of attribute is_private.



11
12
13
# File 'lib/discordrb/events/channel_update.rb', line 11

def is_private
  @is_private
end

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/discordrb/events/channel_update.rb', line 10

def name
  @name
end

#positionObject (readonly)

Returns the value of attribute position.



9
10
11
# File 'lib/discordrb/events/channel_update.rb', line 9

def position
  @position
end

#serverObject (readonly)

Returns the value of attribute server.



13
14
15
# File 'lib/discordrb/events/channel_update.rb', line 13

def server
  @server
end

#topicObject (readonly)

Returns the value of attribute topic.



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

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