Class: Discordrb::Events::ChannelCreateEvent

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

Overview

Raised when a channel is created

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, bot) ⇒ ChannelCreateEvent

Returns a new instance of ChannelCreateEvent.



9
10
11
12
13
14
15
16
17
# File 'lib/discordrb/events/channel_create.rb', line 9

def initialize(data, bot)
  @type = data['type']
  @topic = data['topic']
  @position = data['position']
  @name = data['name']
  @is_private = data['is_private']
  @id = data['id']
  @server = bot.server(data['guild_id'].to_i)
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#is_privateObject (readonly)

Returns the value of attribute is_private.



7
8
9
# File 'lib/discordrb/events/channel_create.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_create.rb', line 7

def name
  @name
end

#positionObject (readonly)

Returns the value of attribute position.



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

def position
  @position
end

#serverObject (readonly)

Returns the value of attribute server.



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

def server
  @server
end

#topicObject (readonly)

Returns the value of attribute topic.



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

def topic
  @topic
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end