Class: Discorb::CategoryChannel

Inherits:
GuildChannel show all
Includes:
ChannelContainer
Defined in:
lib/discorb/channel/category.rb

Overview

Represents a category in a guild.

Instance Attribute Summary

Attributes inherited from GuildChannel

#permission_overwrites, #position

Attributes inherited from Channel

#id, #name

Instance Method Summary collapse

Methods included from ChannelContainer

#news_channels, #stage_channels, #text_channels, #voice_channels

Methods inherited from GuildChannel

#<=>, #==, #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



12
13
14
15
16
# File 'lib/discorb/channel/category.rb', line 12

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

#create_news_channel(*args, **kwargs) ⇒ Object



26
27
28
# File 'lib/discorb/channel/category.rb', line 26

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

#create_stage_channel(*args, **kwargs) ⇒ Object



30
31
32
# File 'lib/discorb/channel/category.rb', line 30

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

#create_text_channel(*args, **kwargs) ⇒ Object



18
19
20
# File 'lib/discorb/channel/category.rb', line 18

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

#create_voice_channel(*args, **kwargs) ⇒ Object



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

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