Class: Rubycord::Events::ChannelCreateEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/rubycord/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.



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

#channelChannel (readonly)

Returns the channel in question.

Returns:

  • (Channel)

    the channel in question.



8
9
10
# File 'lib/rubycord/events/channels.rb', line 8

def channel
  @channel
end

#idInteger (readonly)

Returns the channel's unique ID.

Returns:

  • (Integer)

    the channel's unique ID.

See Also:

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

#nameString (readonly)

Returns the channel's name.

Returns:

  • (String)

    the channel's name

See Also:



28
# File 'lib/rubycord/events/channels.rb', line 28

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

#positionInteger (readonly)

Returns the position of the channel in the channels list.

Returns:

  • (Integer)

    the position of the channel in the channels list.

See Also:



28
# File 'lib/rubycord/events/channels.rb', line 28

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

#serverServer (readonly)

Returns the server the channel belongs to.

Returns:

  • (Server)

    the server the channel belongs to.

See Also:



28
# File 'lib/rubycord/events/channels.rb', line 28

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

#topicString (readonly)

Returns the channel's topic.

Returns:

  • (String)

    the channel's topic.

See Also:



28
# File 'lib/rubycord/events/channels.rb', line 28

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

#typeInteger (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:



28
# File 'lib/rubycord/events/channels.rb', line 28

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