Class: RubyCord::Guild::CategoryChannel

Inherits:
Channel show all
Includes:
Internal::ChannelContainer
Defined in:
lib/rubycord/guild/channel/category.rb

Instance Attribute Summary

Attributes inherited from Channel

#permission_overwrites, #position

Attributes inherited from Channel

#id, #name

Instance Method Summary collapse

Methods included from Internal::ChannelContainer

#news_channels, #stage_channels, #text_channels, #voice_channels

Methods inherited from Channel

#<=>, #==, #create_invite, #delete, #delete_permissions, #fetch_invites, #guild, #inspect, #mention, #move, #parent, #set_permissions, #to_s

Methods inherited from Channel

#==, #inspect, #type

Methods inherited from DiscordModel

#==, #eql?, #inspect

Instance Method Details

#channelsObject



13
14
15
16
17
# File 'lib/rubycord/guild/channel/category.rb', line 13

def channels
  @client.channels.values.filter do |channel|
    channel.parent == self && channel.is_a?(RubyCord::GuildChannel)
  end
end

#create_news_channel(*args, **kwargs) ⇒ Async::Task<RubyCord::Guild::NewsChannel>

Returns The created news channel.

Parameters:

  • name (String)

    The name of the channel.

  • topic (String)

    The topic of the channel.

  • rate_limit_per_user (Integer)

    The rate limit per user in the channel.

  • slowmode (Integer)

    Alias for rate_limit_per_user.

  • position (Integer)

    The position of the channel.

  • nsfw (Boolean)

    Whether the channel is nsfw.

  • permission_overwrites (Hash{RubyCord::Guild::Role, RubyCord::Guild::Member => RubyCord::PermissionOverwrite})

    A list of permission overwrites.

  • parent (RubyCord::Guild::CategoryChannel)

    The parent of the channel.

  • reason (String)

    The reason for creating the channel.

Returns:

See Also:



36
37
38
# File 'lib/rubycord/guild/channel/category.rb', line 36

def create_news_channel(*args, **kwargs)
  guild.create_news_channel(*args, parent: self, **kwargs)
end

#create_stage_channel(*args, **kwargs) ⇒ Async::Task<RubyCord::Guild::StageChannel>

Returns The created stage channel.

Parameters:

Returns:

See Also:



43
44
45
# File 'lib/rubycord/guild/channel/category.rb', line 43

def create_stage_channel(*args, **kwargs)
  guild.create_stage_channel(*args, parent: self, **kwargs)
end

#create_text_channel(*args, **kwargs) ⇒ Async::Task<RubyCord::Guild::TextChannel>

Returns The created text channel.

Parameters:

  • name (String)

    The name of the channel.

  • topic (String)

    The topic of the channel.

  • rate_limit_per_user (Integer)

    The rate limit per user in the channel.

  • slowmode (Integer)

    Alias for rate_limit_per_user.

  • position (Integer)

    The position of the channel.

  • nsfw (Boolean)

    Whether the channel is nsfw.

  • permission_overwrites (Hash{RubyCord::Guild::Role, RubyCord::Guild::Member => RubyCord::PermissionOverwrite})

    A list of permission overwrites.

  • parent (RubyCord::Guild::CategoryChannel)

    The parent of the channel.

  • reason (String)

    The reason for creating the channel.

Returns:

See Also:



22
23
24
# File 'lib/rubycord/guild/channel/category.rb', line 22

def create_text_channel(*args, **kwargs)
  guild.create_text_channel(*args, parent: self, **kwargs)
end

#create_voice_channel(*args, **kwargs) ⇒ Async::Task<RubyCord::Guild::VoiceChannel>

Returns The created voice channel.

Parameters:

Returns:

See Also:



29
30
31
# File 'lib/rubycord/guild/channel/category.rb', line 29

def create_voice_channel(*args, **kwargs)
  guild.create_voice_channel(*args, parent: self, **kwargs)
end