Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kariaro/discord-java-demoji
Convert unicode emojis to Discord shortcodes
https://github.com/kariaro/discord-java-demoji
discord emoji
Last synced: 27 days ago
JSON representation
Convert unicode emojis to Discord shortcodes
- Host: GitHub
- URL: https://github.com/kariaro/discord-java-demoji
- Owner: Kariaro
- License: mit
- Created: 2021-10-18T21:47:11.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-19T15:18:40.000Z (about 3 years ago)
- Last Synced: 2024-10-14T06:12:49.430Z (2 months ago)
- Topics: discord, emoji
- Language: Java
- Homepage:
- Size: 118 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# discord-java-demoji
[![Release](https://jitpack.io/v/kariaro/discord-java-demoji.svg)](https://jitpack.io/#kariaro/discord-java-demoji)This library supports Emoji 13.1 and converts all unicode emojis into Discord shortcodes.
```java
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'
}
```