Class: OnyxCord::Events::ChannelCreateEvent
- Defined in:
- lib/onyxcord/events/channels/base.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
Instance Attribute Details
#channel ⇒ Channel (readonly)
Returns the channel in question.
10 11 12 |
# File 'lib/onyxcord/events/channels/base.rb', line 10 def channel @channel end |
#id ⇒ Integer (readonly)
Returns the channel's unique ID.
30 |
# File 'lib/onyxcord/events/channels/base.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/onyxcord/events/channels/base.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/onyxcord/events/channels/base.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/onyxcord/events/channels/base.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/onyxcord/events/channels/base.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/onyxcord/events/channels/base.rb', line 30 delegate :name, :server, :type, :owner_id, :recipients, :topic, :user_limit, :position, :permission_overwrites, to: :channel |
Instance Method Details
#cached_channel(bot, channel_id) ⇒ Object
42 43 44 45 |
# File 'lib/onyxcord/events/channels/base.rb', line 42 def cached_channel(bot, channel_id) channels = bot.instance_variable_get(:@channels) channels&.[](channel_id.to_i) end |
#cached_server(bot, server_id) ⇒ Object
47 48 49 50 51 52 |
# File 'lib/onyxcord/events/channels/base.rb', line 47 def cached_server(bot, server_id) return nil unless server_id servers = bot.instance_variable_get(:@servers) servers&.[](server_id.to_i) end |