Class: Discordrb::Events::ChannelCreateEvent

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

Overview

Raised when a channel is created

Direct Known Subclasses

ChannelUpdateEvent

Instance Attribute Summary collapse

Attributes inherited from Event

#bot

Instance Method Summary collapse

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.

Returns:

  • (Channel) —

    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.

Returns:

  • (Integer) —

    the channel's unique ID.

See Also:

  • Channel#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.

Returns:

  • (String) —

    the channel's name

See Also:



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.

Returns:

  • (Integer) —

    the position of the channel in the channels list.

See Also:



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.

Returns:

  • (Server) —

    the server the channel belongs to.

See Also:



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.

Returns:

  • (String) —

    the channel's topic.

See Also:



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).

Returns:

  • (Integer) —

    the channel's type (0: text, 1: private, 2: voice, 3: group).

See Also:



30
# File 'lib/discordrb/events/channels.rb', line 30

delegate :name, :server, :type, :owner_id, :recipients, :topic, :user_limit, :position, :permission_overwrites, to: :channel