Skip to content

Commit

Permalink
Java: Make the EmojiIndex and Ubescape optional dependencies.
Browse files Browse the repository at this point in the history
Provide them yourself!
  • Loading branch information
e3ndr committed May 2, 2024
1 parent 079e856 commit 5407ec9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@
<groupId>co.casterlabs.EmojiApi</groupId>
<artifactId>Index</artifactId>
<version>3.5.2</version>
<scope>compile</scope>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.unbescape</groupId>
<artifactId>unbescape</artifactId>
<version>1.1.6.RELEASE</version>
<scope>compile</scope>
<scope>provided</scope>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,26 @@
import co.casterlabs.emoji.data.Emoji;
import co.casterlabs.emoji.data.EmojiAssetImageSet;
import co.casterlabs.emoji.data.EmojiAssets;
import co.casterlabs.rakurai.json.Rson;
import co.casterlabs.rakurai.json.annotating.JsonClass;
import co.casterlabs.rakurai.json.element.JsonObject;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
import lombok.SneakyThrows;

@EqualsAndHashCode(callSuper = true)
@JsonClass(exposeAll = true, unsafeInstantiation = true)
public class EmojiFragment extends ChatFragment {
public final @NonNull Emoji.Variation variation;
private final @NonNull JsonObject variation;

private EmojiFragment(String raw, String html, Emoji.Variation variation) {
super(raw, html);
this.variation = variation;
this.variation = (JsonObject) Rson.DEFAULT.toJson(variation);
}

@SneakyThrows
public Emoji.Variation variation() {
return Rson.DEFAULT.fromJson(this.variation, Emoji.Variation.class);
}

@Override
Expand Down

0 comments on commit 5407ec9

Please sign in to comment.