https://github.com/freya022/jda-emojis
Brings emojis to your JDA projects
https://github.com/freya022/jda-emojis
emojis jda
Last synced: 6 months ago
JSON representation
Brings emojis to your JDA projects
- Host: GitHub
- URL: https://github.com/freya022/jda-emojis
- Owner: freya022
- License: apache-2.0
- Created: 2025-01-24T22:40:26.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-13T13:38:16.000Z (over 1 year ago)
- Last Synced: 2025-10-25T07:47:20.792Z (9 months ago)
- Topics: emojis, jda
- Language: Kotlin
- Homepage:
- Size: 104 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[jda-emojis-maven-central-shield]: https://img.shields.io/maven-central/v/dev.freya02/jda-emojis
[jda-emojis-maven-central-link]: https://mvnrepository.com/artifact/dev.freya02/jda-emojis/latest
## JDA Emojis
This is a lightweight and convenient alternative to [JEmoji](https://github.com/felldo/JEmoji), from which it is generated from.
Assuming you only need to use the emojis, you can use them directly with JDA instead of having to convert them!
## Installation
[![jda-emojis-maven-central-shield]][jda-emojis-maven-central-link]
The minimum Java version supported is Java 11.
### Kotlin Gradle
```kt
repositories {
mavenCentral()
}
dependencies {
implementation("dev.freya02:jda-emojis:$version") // replace $version with the latest version
}
```
### Maven
```xml
dev.freya02
jda-emojis
${version}
```
## Usage
There are two classes you can use `Emojis` and `UnicodeEmojis`, you can use either of them, they are the same.
This library only provides known emojis as constants, if you need to retrieve them from a string, you will have to use JEmoji.
## Examples
### Buttons
```java
Button approve = Button.primary("approve:data", "Approve").withEmoji(Emojis.WHITE_CHECK_MARK);
```
### Select menus
```java
StringSelectMenu choices = StringSelectMenu.create("choices:data")
.addOptions(
SelectOption.of("First choice", "1").withEmoji(Emojis.ONE)
)
.build();
```
### Reactions
```java
MessageCreateData messageData = new MessageCreateBuilder()
.addActionRow(approve)
.addActionRow(choices)
.build();
event.reply(messageData)
// Since we reply to a slash command, we need to retrieve the message back
.flatMap(InteractionHook::retrieveOriginal)
// This emoji's name is slightly different as fields can't start with digits
.flatMap(message -> message.addReaction(Emojis.HUNDRED_POINTS))
.queue();
```

## License
This project is licensed using the Apache 2.0 license.
The code was also partially generated from JEmoji, using the [same license](https://github.com/felldo/JEmoji/blob/master/LICENSE).