Class: Rubycord::Events::ChannelCreateEvent
- Defined in:
- lib/rubycord/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 ⇒ Integer
readonly
The channel's type (0: text, 1: private, 2: voice, 3: group).
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.
30 31 32 33 |
# File 'lib/rubycord/events/channels.rb', line 30 def initialize(data, bot) @bot = bot @channel = data.is_a?(Rubycord::Channel) ? data : bot.channel(data["id"].to_i) end |
Instance Attribute Details
#channel ⇒ Channel (readonly)
Returns the channel in question.
8 9 10 |
# File 'lib/rubycord/events/channels.rb', line 8 def channel @channel end |
#id ⇒ Integer (readonly)
Returns the channel's unique ID.
28 |
# File 'lib/rubycord/events/channels.rb', line 28 delegate :name, :server, :type, :owner_id, :recipients, :topic, :user_limit, :position, :permission_overwrites, to: :channel |
#name ⇒ String (readonly)
Returns the channel's name.
28 |
# File 'lib/rubycord/events/channels.rb', line 28 delegate :name, :server, :type, :owner_id, :recipients, :topic, :user_limit, :position, :permission_overwrites, to: :channel |
#position ⇒ Integer (readonly)
Returns the position of the channel in the channels list.
28 |
# File 'lib/rubycord/events/channels.rb', line 28 delegate :name, :server, :type, :owner_id, :recipients, :topic, :user_limit, :position, :permission_overwrites, to: :channel |
#server ⇒ Server (readonly)
Returns the server the channel belongs to.
28 |
# File 'lib/rubycord/events/channels.rb', line 28 delegate :name, :server, :type, :owner_id, :recipients, :topic, :user_limit, :position, :permission_overwrites, to: :channel |
#topic ⇒ String (readonly)
Returns the channel's topic.
28 |
# File 'lib/rubycord/events/channels.rb', line 28 delegate :name, :server, :type, :owner_id, :recipients, :topic, :user_limit, :position, :permission_overwrites, to: :channel |
#type ⇒ Integer (readonly)
Returns the channel's type (0: text, 1: private, 2: voice, 3: group).
28 |
# File 'lib/rubycord/events/channels.rb', line 28 delegate :name, :server, :type, :owner_id, :recipients, :topic, :user_limit, :position, :permission_overwrites, to: :channel |