Class: Discordrb::Channel

Inherits:
Object
  • Object
show all
Defined in:
lib/esm/extension/core/discordrb/channel.rb

Constant Summary collapse

TYPE_NAMES =
{
  0 => :text,
  1 => :dm,
  2 => :voice,
  3 => :group,
  4 => :category
}.freeze

Instance Method Summary collapse

Instance Method Details

#to_hObject Also known as: attributes



13
14
15
16
17
18
19
20
21
# File 'lib/esm/extension/core/discordrb/channel.rb', line 13

def to_h
  {
    id: id.to_s,
    name: name,
    position: position,
    type: TYPE_NAMES[type],
    category: category&.to_h
  }
end