Class: DSU3::Message
Overview
Message object
Instance Attribute Summary
Attributes inherited from DObject
Instance Method Summary collapse
-
#initialize(channel, id) ⇒ Message
constructor
A new instance of Message.
-
#react(emoji, cooldown = 0) ⇒ Object
Reacts to a message.
Constructor Details
#initialize(channel, id) ⇒ Message
Returns a new instance of Message.
8 9 10 11 |
# File 'lib/dsu3/data/message.rb', line 8 def initialize(channel, id) super(channel.net, id) @channel_id = channel.id end |
Instance Method Details
#react(emoji, cooldown = 0) ⇒ Object
Note:
To use custom emoji, you must encode it in the format name:id with the emoji name and emoji id
Reacts to a message
17 18 19 |
# File 'lib/dsu3/data/message.rb', line 17 def react(emoji, cooldown = 0) @net.request(seq: true, cooldown: cooldown) { DSU3::API::Message.react(_1, @channel_id, @id, emoji) } end |