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 ⇒ 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.
32 33 34 35 |
# File 'lib/discordrb/events/channels.rb', line 32 def initialize(data, bot) @bot = bot @channel = data.is_a?(Discordrb::Channel) ? data : 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 :name, :server, :type, :owner_id, :recipients, :topic, :user_limit, :position, :permission_overwrites, to: :channel |
#name ⇒ String (readonly)
Returns the channel’s name.
30 |
# File 'lib/discordrb/events/channels.rb', line 30 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.
30 |
# File 'lib/discordrb/events/channels.rb', line 30 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.
30 |
# File 'lib/discordrb/events/channels.rb', line 30 delegate :name, :server, :type, :owner_id, :recipients, :topic, :user_limit, :position, :permission_overwrites, to: :channel |
#topic ⇒ String (readonly)
Returns the channel’s topic.
30 |
# File 'lib/discordrb/events/channels.rb', line 30 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).
30 |
# File 'lib/discordrb/events/channels.rb', line 30 delegate :name, :server, :type, :owner_id, :recipients, :topic, :user_limit, :position, :permission_overwrites, to: :channel |