A simple (for now) Discord chat bridge for Hytale. modtale.net/mod/lattice
java discord discord-bot hytale hytale-plugin hytale-mod hytale-modding hytale-mods

Add Hyvatar support #1

merged opened by auri.tngl.sh targeting main from auri.tngl.sh/lattice: main

Allows users to enable Hyvatar support in the config, giving the webhooks profile pictures using the Hyvatar API.

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:rpyv6r4snjvdb53fpntwknli/sh.tangled.repo.pull/3mdsxw66e3222
+10
Diff #1
+2
src/main/java/me/theclashfruit/lattice/events/PlayerEvents.java
··· 52 52 } 53 53 54 54 hook.flatMap(h -> h.sendMessage(content).setUsername(user.getEffectiveName()).setAvatarUrl(user.getAvatarUrl())).queue(); 55 + } else if (LatticePlugin.config.get().discord.messages.useHyvatarAvatars) { 56 + hook.flatMap(h -> h.sendMessage(content).setUsername(sender.getUsername()).setAvatarUrl("https://hyvatar.io/render/%s?size=256".formatted(sender.getUsername()))).queue(); 55 57 } else { 56 58 hook.flatMap(h -> h.sendMessage(content).setUsername(sender.getUsername())).queue(); 57 59 }
+8
src/main/java/me/theclashfruit/lattice/util/LatticeConfig.java
··· 99 99 (config, info) -> config.leave 100 100 ) 101 101 .add() 102 + .append( 103 + new KeyedCodec<>("UseHyvatarAvatars", BuilderCodec.BOOLEAN), 104 + (config, value, info) -> config.useHyvatarAvatars = value, 105 + (config, info) -> config.useHyvatarAvatars 106 + ) 107 + .add() 102 108 .build(); 103 109 104 110 public String join = "%s joined %s."; 105 111 public String leave = "%s left."; 112 + 113 + public boolean useHyvatarAvatars = false; 106 114 } 107 115 } 108 116 }

History

2 rounds 0 comments
sign up or login to add to the discussion
2 commits
expand
Add Hyvatar support
Fix build.gradle
expand 0 comments
pull request successfully merged
1 commit
expand
Add Hyvatar support
expand 0 comments