Class: Discordrb::Channel

Inherits:
Object
  • Object
show all
Defined in:
lib/discordrb/data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, bot) ⇒ Channel

Returns a new instance of Channel.



25
26
27
28
29
30
31
32
# File 'lib/discordrb/data.rb', line 25

def initialize(data, bot)
  @bot = bot
  @name = data['name']
  @server_id = data['guild_id']
  @type = data['type']
  @id = data['id']
  @is_private = data['is_private']
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



23
24
25
# File 'lib/discordrb/data.rb', line 23

def id
  @id
end

#is_privateObject (readonly)

Returns the value of attribute is_private.



23
24
25
# File 'lib/discordrb/data.rb', line 23

def is_private
  @is_private
end

#nameObject (readonly)

Returns the value of attribute name.



23
24
25
# File 'lib/discordrb/data.rb', line 23

def name
  @name
end

#server_idObject (readonly)

Returns the value of attribute server_id.



23
24
25
# File 'lib/discordrb/data.rb', line 23

def server_id
  @server_id
end

#typeObject (readonly)

Returns the value of attribute type.



23
24
25
# File 'lib/discordrb/data.rb', line 23

def type
  @type
end

Instance Method Details

#send_message(content) ⇒ Object Also known as: send, message



34
35
36
# File 'lib/discordrb/data.rb', line 34

def send_message(content)
  @bot.send_message(@id, content)
end