Class: Discordrb::Channel
- Inherits:
-
Object
- Object
- Discordrb::Channel
- Defined in:
- lib/discordrb/data.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#is_private ⇒ Object
readonly
Returns the value of attribute is_private.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#server_id ⇒ Object
readonly
Returns the value of attribute server_id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(data, bot) ⇒ Channel
constructor
A new instance of Channel.
- #send_message(content) ⇒ Object (also: #send, #message)
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
#id ⇒ Object (readonly)
Returns the value of attribute id.
23 24 25 |
# File 'lib/discordrb/data.rb', line 23 def id @id end |
#is_private ⇒ Object (readonly)
Returns the value of attribute is_private.
23 24 25 |
# File 'lib/discordrb/data.rb', line 23 def is_private @is_private end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
23 24 25 |
# File 'lib/discordrb/data.rb', line 23 def name @name end |
#server_id ⇒ Object (readonly)
Returns the value of attribute server_id.
23 24 25 |
# File 'lib/discordrb/data.rb', line 23 def server_id @server_id end |
#type ⇒ Object (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 (content) @bot.(@id, content) end |