Skip to content

Commit

Permalink
fix(reaction): fixed reactions failing because the emoji wasn't encod…
Browse files Browse the repository at this point in the history
…ed correctly
  • Loading branch information
seailz committed Sep 24, 2023
1 parent 823ed85 commit c31bb5f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.springframework.web.bind.annotation.RequestMethod;

import java.lang.reflect.InvocationTargetException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
Expand Down Expand Up @@ -540,7 +542,7 @@ public Response<Void> createReaction(@NotNull Emoji emoji) {
new DiscordRequest(
new JSONObject(),
new HashMap<>(),
URLS.PUT.MESSAGES.ADD_REACTION.replace("{channel.id}", channelId).replace("{message.id}", id).replace("{emoji}", emoji.toSimpleString()),
URLS.PUT.MESSAGES.ADD_REACTION.replace("{channel.id}", channelId).replace("{message.id}", id).replace("{emoji}", URLEncoder.encode(emoji.toSimpleString(), StandardCharsets.UTF_8)),
discordJar,
URLS.PUT.MESSAGES.ADD_REACTION,
RequestMethod.PUT
Expand Down

0 comments on commit c31bb5f

Please sign in to comment.