Class: Discordrb::Events::ChannelCreateEvent
- Defined in:
- lib/discordrb/events/channels.rb
Overview
Raised when a channel is created
Direct Known Subclasses
Instance Attribute Summary collapse
-
#channel ⇒ Channel
readonly
The channel in question.
-
#id ⇒ Integer
readonly
The channel's unique ID.
-
#name ⇒ String
readonly
The channel's name.
-
#position ⇒ Integer
readonly
The position of the channel in the channels list.
-
#server ⇒ Server
readonly
The server the channel belongs to.
-
#topic ⇒ String
readonly
The channel's topic.
-
#type ⇒ String
readonly
The channel's type.
Attributes inherited from Event
Instance Method Summary collapse
-
#initialize(data, bot) ⇒ ChannelCreateEvent
constructor
A new instance of ChannelCreateEvent.
Constructor Details
#initialize(data, bot) ⇒ ChannelCreateEvent
Returns a new instance of ChannelCreateEvent.
32 33 34 35 |
# File 'lib/discordrb/events/channels.rb', line 32 def initialize(data, bot) @bot = bot @channel = bot.channel(data['id'].to_i) end |
Instance Attribute Details
#channel ⇒ Channel (readonly)
Returns the channel in question.
10 11 12 |
# File 'lib/discordrb/events/channels.rb', line 10 def channel @channel end |
#id ⇒ Integer (readonly)
Returns the channel's unique ID.
30 |
# File 'lib/discordrb/events/channels.rb', line 30 delegate :type, :topic, :position, :name, :id, :server, to: :channel |
#name ⇒ String (readonly)
Returns the channel's name.
30 |
# File 'lib/discordrb/events/channels.rb', line 30 delegate :type, :topic, :position, :name, :id, :server, to: :channel |
#position ⇒ Integer (readonly)
Returns the position of the channel in the channels list.
30 |
# File 'lib/discordrb/events/channels.rb', line 30 delegate :type, :topic, :position, :name, :id, :server, to: :channel |
#server ⇒ Server (readonly)
Returns the server the channel belongs to.
30 |
# File 'lib/discordrb/events/channels.rb', line 30 delegate :type, :topic, :position, :name, :id, :server, to: :channel |
#topic ⇒ String (readonly)
Returns the channel's topic.
30 |
# File 'lib/discordrb/events/channels.rb', line 30 delegate :type, :topic, :position, :name, :id, :server, to: :channel |
#type ⇒ String (readonly)
Returns the channel's type.
30 |
# File 'lib/discordrb/events/channels.rb', line 30 delegate :type, :topic, :position, :name, :id, :server, to: :channel |