Created
March 28, 2018 21:08
-
-
Save charagarlnad/9c5e8dffbc0f293dc615173aefabcde8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Discordrb::API::Channel | |
module_function | |
def create_reaction(token, channel_id, message_id, emoji) | |
emoji = URI.encode(emoji) unless emoji.ascii_only? | |
Discordrb::API.raw_request( | |
:put, | |
["#{Discordrb::API.api_base}/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}/@me", | |
nil, | |
Authorization: token, | |
content_type: :json] | |
) | |
sleep(0.25) | |
end | |
end | |
# https://github.com/meew0/discordrb/blob/cb074e0f80c078c09ca432893c1601d28bf78adb/lib/discordrb/api/channel.rb#L142 | |
# https://github.com/meew0/discordrb/blob/ef88d4ed27fc2520c1db3fcb21897f60e7d39bc3/lib/discordrb/api.rb#L90 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment