Skip to content
This repository was archived by the owner on Dec 1, 2021. It is now read-only.

Commit 8fe6ce3

Browse files
authored
Merge pull request #73 from hochladen/patch-1
URL Encode reaction text
2 parents c7a278f + 5051ca7 commit 8fe6ce3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/aegis/impl/channel.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ AEGIS_DECL aegis::future<rest::rest_reply> channel::create_reaction(snowflake me
438438

439439
std::shared_lock<shared_mutex> l(_m);
440440

441-
std::string _endpoint = fmt::format("/channels/{}/messages/{}/reactions/{}/@me", channel_id, message_id, emoji_text);
441+
std::string _endpoint = fmt::format("/channels/{}/messages/{}/reactions/{}/@me", channel_id, message_id, utility::url_encode(emoji_text));
442442
std::string _bucket = fmt::format("/guilds/{}/reactions", guild_id);
443443
_ratelimit.get_bucket(_bucket).reset_bypass = 250;
444444
return _ratelimit.post_task(_bucket, { _endpoint, rest::Put });
@@ -453,7 +453,7 @@ AEGIS_DECL aegis::future<rest::rest_reply> channel::delete_own_reaction(snowflak
453453

454454
std::shared_lock<shared_mutex> l(_m);
455455

456-
std::string _endpoint = fmt::format("/channels/{}/messages/{}/reactions/{}/@me", channel_id, message_id, emoji_text);
456+
std::string _endpoint = fmt::format("/channels/{}/messages/{}/reactions/{}/@me", channel_id, message_id, utility::url_encode(emoji_text));
457457
std::string _bucket = fmt::format("/guilds/{}/reactions", guild_id);
458458
_ratelimit.get_bucket(_bucket).reset_bypass = 250;
459459
return _ratelimit.post_task(_bucket, { _endpoint, rest::Delete });
@@ -469,7 +469,7 @@ AEGIS_DECL aegis::future<rest::rest_reply> channel::delete_user_reaction(snowfla
469469

470470
std::shared_lock<shared_mutex> l(_m);
471471

472-
std::string _endpoint = fmt::format("/channels/{}/messages/{}/reactions/{}/{}", channel_id, message_id, emoji_text, member_id);
472+
std::string _endpoint = fmt::format("/channels/{}/messages/{}/reactions/{}/{}", channel_id, message_id, utility::url_encode(emoji_text), member_id);
473473
std::string _bucket = fmt::format("/channels/{}/messages/_/reactions/", channel_id);
474474
return _ratelimit.post_task(_bucket, { _endpoint, rest::Delete });
475475
}

0 commit comments

Comments
 (0)