Created
May 31, 2017 07:21
-
-
Save jamietech/7c0b01be2ff6439c97fbec55e82daad5 to your computer and use it in GitHub Desktop.
Add reactions to JDA messages with letters
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
package emoji; | |
import net.dv8tion.jda.core.entities.Message; | |
public class letters { | |
private final String[] letters = new String[] { "\uD83C\uDDE6", "\uD83C\uDDE7", "\uD83C\uDDE8", "\uD83C\uDDE9", "\uD83C\uDDEA", "\uD83C\uDDEB", "\uD83C\uDDEC", "\uD83C\uDDED", "\uD83C\uDDEE", "\uD83C\uDDEF", "\uD83C\uDDF0", "\uD83C\uDDF1", "\uD83C\uDDF2", "\uD83C\uDDF3", "\uD83C\uDDF4", "\uD83C\uDDF5", "\uD83C\uDDF6", "\uD83C\uDDF7", "\uD83C\uDDF8", "\uD83C\uDDF9", "\uD83C\uDDFA", "\uD83C\uDDFB", "\uD83C\uDDFC", "\uD83C\uDDFD", "\uD83C\uDDFE", "\uD83C\uDDFF" }; | |
public void react(Message message, String reaction) { | |
for (final char c : reaction.toUpperCase().toCharArray()) { | |
message.addReaction(this.letters[c - 64 - 1]).queue(); // 64 is char padding, 1 is array starting at 0 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
react(e.getMessage(), "TOP");