Skip to content

Commit

Permalink
fix: Add a fallback if nothing is displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
alt-art committed Jun 16, 2024
1 parent 7fe29e4 commit 86987dd
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public void onUpdateReceived(@NotNull Update update) {
if (username == null) {
username = String.format("%s %s", message.getFrom().getFirstName(), message.getFrom().getLastName());
}
if (username.trim().isEmpty()) {
username = "Anonymous";
}
TelegramBridge.log.info("Telegram message received from " + username + ": " + text);
for (Player player : Bukkit.getOnlinePlayers()) {
if (player.hasPermission(Permissions.RECEIVE.getString())) {
Expand Down

0 comments on commit 86987dd

Please sign in to comment.