Skip to content

Kariaro/discord-java-demoji

Repository files navigation

discord-java-demoji

Release

This library supports Emoji 13.1 and converts all unicode emojis into Discord shortcodes.

String result = EmojiParser.parse("Hello world! ☺");
System.out.println(result); // "Hello world! :relaxed:"

Unit tests can be found in src/test/java/test

Generating the mappings

This library requires a mapping file to correctly convert emoji to shortcodes. If you want to update the emoji.json file to handle more shortcodes you can run the mapping generator com.hardcoded.generator.EmojiMappingGenerator.

There is no general solution to generating the mappings for this project and the format discord uses could change in the future.

The internal format of this project will not change.

Usage

To use this library include this in your build.gradle

repositories {
    jcenter()
    maven { url 'https://jitpack.io' }
}
dependencies {
    implementation 'com.github.hardcoded:discord-java-demoji:version'
}

About

Convert unicode emojis to Discord shortcodes

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages