diff --git a/src/commander/java/com/mcmoddev/mmdbot/commander/commands/VersionCommand.java b/src/commander/java/com/mcmoddev/mmdbot/commander/commands/VersionCommand.java index 2b56e27e..989fd087 100644 --- a/src/commander/java/com/mcmoddev/mmdbot/commander/commands/VersionCommand.java +++ b/src/commander/java/com/mcmoddev/mmdbot/commander/commands/VersionCommand.java @@ -186,7 +186,7 @@ public final class VersionCommand { final var id = matcher.group("id"); event.deferReply() .addEmbeds(getMavenInfo(repo, group, id) - .setFooter("Requested by: " + event.getUser().getAsTag(), event.getUser().getAvatarUrl()) + .setFooter("Requested by: " + event.getUser().getName(), event.getUser().getAvatarUrl()) .setTimestamp(Instant.now()) .build() ) diff --git a/src/commander/java/com/mcmoddev/mmdbot/commander/commands/curseforge/CFProjectCommand.java b/src/commander/java/com/mcmoddev/mmdbot/commander/commands/curseforge/CFProjectCommand.java index eabc29de..38cc08d9 100644 --- a/src/commander/java/com/mcmoddev/mmdbot/commander/commands/curseforge/CFProjectCommand.java +++ b/src/commander/java/com/mcmoddev/mmdbot/commander/commands/curseforge/CFProjectCommand.java @@ -117,7 +117,7 @@ protected void execute(final CFCommandContext context, final CurseForgeManager m setEmbedAuthor(embed); final var user = TheCommander.getJDA().getUserById(arguments.get(0)); if (user != null) { - embed.setFooter("Requested by: " + user.getAsTag(), user.getAvatarUrl()); + embed.setFooter("Requested by: " + user.getName(), user.getAvatarUrl()); } if (arguments.size() > startingIndex + 1) { arguments.subList(startingIndex + 1, Math.min(maximum, arguments.size())) @@ -171,7 +171,7 @@ protected void execute(final CFCommandContext context, final CurseForgeManager m final var embed = new EmbedBuilder() .setTimestamp(Instant.now()) .setColor(Color.GREEN) - .setFooter("Requested by: " + context.getUser().getAsTag(), context.getUser().getAvatarUrl()) + .setFooter("Requested by: " + context.getUser().getName(), context.getUser().getAvatarUrl()) .setTitle(mod.name(), mod.links().websiteUrl()) .setThumbnail(mod.logo().thumbnailUrl()) .setDescription(mod.summary()) diff --git a/src/commander/java/com/mcmoddev/mmdbot/commander/commands/tricks/RawTrickCommand.java b/src/commander/java/com/mcmoddev/mmdbot/commander/commands/tricks/RawTrickCommand.java index 0bec075e..bf09fc7d 100644 --- a/src/commander/java/com/mcmoddev/mmdbot/commander/commands/tricks/RawTrickCommand.java +++ b/src/commander/java/com/mcmoddev/mmdbot/commander/commands/tricks/RawTrickCommand.java @@ -64,7 +64,7 @@ protected void execute(final SlashCommandEvent event) { event.replyEmbeds(new EmbedBuilder().setTitle("Raw contents of " + trickName) .setDescription(MarkdownUtil.codeblock(trick instanceof ScriptTrick ? "js" : null, trick.getRaw())).setColor(Color.GREEN) .addField("Trick Names", String.join(" ", trick.getNames()), false) - .setTimestamp(Instant.now()).setFooter("Requested by: " + event.getUser().getAsTag(), + .setTimestamp(Instant.now()).setFooter("Requested by: " + event.getUser().getName(), event.getUser().getAvatarUrl()).build()).addActionRow(DismissListener.createDismissButton(event)).queue(); }, () -> event.reply("This trick does not exist anymore!").setEphemeral(true).queue()); } diff --git a/src/commander/java/com/mcmoddev/mmdbot/commander/eventlistener/ReferencingListener.java b/src/commander/java/com/mcmoddev/mmdbot/commander/eventlistener/ReferencingListener.java index 832d25e7..ee89713f 100644 --- a/src/commander/java/com/mcmoddev/mmdbot/commander/eventlistener/ReferencingListener.java +++ b/src/commander/java/com/mcmoddev/mmdbot/commander/eventlistener/ReferencingListener.java @@ -78,7 +78,7 @@ public static MessageEmbed reference(@NonNull final Message message, final Membe final var embed = new EmbedBuilder().setTimestamp(message.getTimeCreated()) .setColor(Color.DARK_GRAY); if (hasAuthor) { - embed.setAuthor(message.getAuthor().getAsTag(), msgLink, message.getAuthor().getEffectiveAvatarUrl()); + embed.setAuthor(message.getAuthor().getName(), msgLink, message.getAuthor().getEffectiveAvatarUrl()); } if (!message.getContentRaw().isBlank()) { embed.appendDescription(MarkdownUtil.maskedLink("Reference ➤ ", msgLink)) @@ -87,7 +87,7 @@ public static MessageEmbed reference(@NonNull final Message message, final Membe embed.appendDescription(MarkdownUtil.maskedLink("Jump to referenced message.", msgLink)); } if (quoter.getIdLong() != message.getAuthor().getIdLong()) { - embed.setFooter(quoter.getUser().getAsTag() + " referenced", quoter.getEffectiveAvatarUrl()); + embed.setFooter(quoter.getUser().getName() + " referenced", quoter.getEffectiveAvatarUrl()); } if (!message.getAttachments().isEmpty()) { embed.setImage(message.getAttachments().get(0).getUrl()); diff --git a/src/commander/java/com/mcmoddev/mmdbot/commander/quotes/UserReference.java b/src/commander/java/com/mcmoddev/mmdbot/commander/quotes/UserReference.java index 6f566ac2..ca3397d2 100644 --- a/src/commander/java/com/mcmoddev/mmdbot/commander/quotes/UserReference.java +++ b/src/commander/java/com/mcmoddev/mmdbot/commander/quotes/UserReference.java @@ -149,7 +149,7 @@ public String resolveReference() { User user = TheCommander.getJDA().getUserById(getSnowflakeData()); // If we have it... if (user != null) { - return user.getAsTag(); + return user.getName(); } else { return String.valueOf(getSnowflakeData()); } diff --git a/src/commander/java/com/mcmoddev/mmdbot/commander/util/script/ScriptingUtils.java b/src/commander/java/com/mcmoddev/mmdbot/commander/util/script/ScriptingUtils.java index 52208e5a..64c38945 100644 --- a/src/commander/java/com/mcmoddev/mmdbot/commander/util/script/ScriptingUtils.java +++ b/src/commander/java/com/mcmoddev/mmdbot/commander/util/script/ScriptingUtils.java @@ -357,7 +357,7 @@ public static ScriptingContext createUser(User user, boolean canDm) { context.set("avatarUrl", user.getAvatarUrl()); context.set("isBot", user.isBot()); context.set("hasPrivateChannel", user.hasPrivateChannel()); - context.setFunction("asTag", args -> user.getAsTag()); + context.setFunction("asTag", args -> user.getName()); context.setFunction("openPrivateChannel", args -> { validateArgs(args, 0); final var privateChannel = user.openPrivateChannel().complete(); diff --git a/src/listener/java/com/mcmoddev/mmdbot/thelistener/events/LeaveJoinEvents.java b/src/listener/java/com/mcmoddev/mmdbot/thelistener/events/LeaveJoinEvents.java index 25824ff2..3d18cb80 100644 --- a/src/listener/java/com/mcmoddev/mmdbot/thelistener/events/LeaveJoinEvents.java +++ b/src/listener/java/com/mcmoddev/mmdbot/thelistener/events/LeaveJoinEvents.java @@ -44,7 +44,7 @@ public void onGuildMemberJoin(@NotNull final GuildMemberJoinEvent event) { final var embed = new EmbedBuilder() .setColor(Color.GREEN) .setTitle("User Joined") - .addField("User:", event.getMember().getUser().getAsTag(), true) + .addField("User:", event.getMember().getUser().getName(), true) .setFooter("User ID: " + event.getMember().getId(), event.getMember().getEffectiveAvatarUrl()) .setTimestamp(Instant.now()) .build(); @@ -71,7 +71,7 @@ public void onGuildMemberRemove(@NotNull final GuildMemberRemoveEvent event) { final var embed = new EmbedBuilder() .setColor(Color.RED) .setTitle("User Left") - .addField("User:", event.getUser().getAsTag(), true) + .addField("User:", event.getUser().getName(), true) .addField("Roles", RoleEvents.mentionsOrEmpty(event.getMember().getRoles()), false) .setFooter("User ID: " + event.getMember().getId(), event.getMember().getEffectiveAvatarUrl()) .setTimestamp(Instant.now()) diff --git a/src/listener/java/com/mcmoddev/mmdbot/thelistener/events/ModerationEvents.java b/src/listener/java/com/mcmoddev/mmdbot/thelistener/events/ModerationEvents.java index 521181fb..6475b2da 100644 --- a/src/listener/java/com/mcmoddev/mmdbot/thelistener/events/ModerationEvents.java +++ b/src/listener/java/com/mcmoddev/mmdbot/thelistener/events/ModerationEvents.java @@ -127,7 +127,7 @@ public void onBan(final User bannedUser, final User bannedBy, final AuditLogEntr final var embed = new EmbedBuilder(); embed.setColor(Color.RED); embed.setTitle("User Banned."); - embed.addField("**User:**", bannedUser.getAsTag(), true); + embed.addField("**User:**", bannedUser.getName(), true); embed.addField("**Ban reason:**", reason, false); embed.setFooter("User ID: " + bannedUser.getId(), bannedUser.getEffectiveAvatarUrl()); embed.setTimestamp(Instant.now()); @@ -139,7 +139,7 @@ public void onUnban(final User unBannedUser, final User bannedBy, final AuditLog final var embed = new EmbedBuilder(); embed.setColor(Color.GREEN); embed.setTitle("User Un-banned."); - embed.addField("**User:**", unBannedUser.getAsTag(), true); + embed.addField("**User:**", unBannedUser.getName(), true); embed.setFooter("User ID: " + unBannedUser.getId(), unBannedUser.getEffectiveAvatarUrl()); embed.setTimestamp(Instant.now()); @@ -150,7 +150,7 @@ public void onNicknameUpdate(final User target, final User editor, final AuditLo final var embed = new EmbedBuilder(); embed.setColor(Color.YELLOW); embed.setTitle("Nickname Changed"); - embed.addField("User:", target.getAsTag(), true); + embed.addField("User:", target.getName(), true); embed.addField("Old Nickname:", wrapNicknameValue(nicknameChange.getOldValue()), true); embed.addField("New Nickname:", wrapNicknameValue(nicknameChange.getNewValue()), true); embed.setFooter("User ID: " + target.getId(), target.getEffectiveAvatarUrl()); @@ -166,7 +166,7 @@ private static String wrapNicknameValue(@Nullable String nicknameValue) { public void onKick(final User kickedUser, final User kicker, final AuditLogEntry entry) { final var embed = new EmbedBuilder(); if (kicker.isBot()) { - var botKickMessage = kickedUser.getAsTag() + " was kicked! Kick Reason: " + entry.getReason(); + var botKickMessage = kickedUser.getName() + " was kicked! Kick Reason: " + entry.getReason(); log(entry.getGuild().getIdLong(), entry.getJDA(), botKickMessage, kicker); } else { final var reason = requireNonNullElse(entry.getReason(), "Reason for kick was not provided or could not be found, please contact " @@ -174,7 +174,7 @@ public void onKick(final User kickedUser, final User kicker, final AuditLogEntry embed.setColor(RUBY); embed.setTitle("User Kicked"); - embed.addField("**Name:**", kickedUser.getAsTag(), true); + embed.addField("**Name:**", kickedUser.getName(), true); embed.addField("**Kick reason:**", reason, false); embed.setFooter("User ID: " + kickedUser.getId(), kickedUser.getAvatarUrl()); embed.setTimestamp(Instant.now()); @@ -198,7 +198,7 @@ public void onTimeoutUpdate(final User user, final User moderator, final AuditLo embed.setColor(LIGHT_SEA_GREEN); embed.setTitle("User Timed Out"); - embed.addField("**User:**", user.getAsTag(), true); + embed.addField("**User:**", user.getName(), true); embed.addField("**Timeout End:**", TimeFormat.RELATIVE.format(newTimeoutEnd), true); embed.addField("**Reason:**", reason, false); @@ -212,7 +212,7 @@ public void onTimeoutUpdate(final User user, final User moderator, final AuditLo embed.setColor(Color.CYAN); embed.setTitle("User Timeout Removed"); - embed.addField("**User:**", user.getAsTag(), true); + embed.addField("**User:**", user.getName(), true); embed.addField("**Old Timeout End:**", TimeFormat.RELATIVE.format(oldTimeoutEnd), true); embed.setFooter("User ID: " + user.getId(), user.getEffectiveAvatarUrl()); @@ -238,7 +238,7 @@ public void onWarnAdd(final WarningEvent.Add event) { final var embed = new EmbedBuilder() .setColor(Color.RED) .setTitle("Warning Added") - .setDescription(user.getAsTag() + " has been given a warning.") + .setDescription(user.getName() + " has been given a warning.") .addField("Warning Reason:", doc.reason(), false) .addField("Warning ID:", doc.warnId(), false) .setFooter("User ID: " + user.getId(), user.getEffectiveAvatarUrl()) @@ -259,7 +259,7 @@ public void onWarnClear(final WarningEvent.Clear event) { final var embed = new EmbedBuilder() .setColor(Color.GREEN) .setTitle("Warning Removed") - .setDescription("One of the warnings of " + user.getAsTag() + " has been removed!") + .setDescription("One of the warnings of " + user.getName() + " has been removed!") .setThumbnail(user.getAvatarUrl()) .addField("Old Warning:", warnDoc.reason(), false) .setFooter("User ID: " + user.getId(), user.getEffectiveAvatarUrl()) @@ -279,7 +279,7 @@ public void onWarnClearAll(final WarningEvent.ClearAllWarns event) { final var embed = new EmbedBuilder() .setColor(java.awt.Color.GREEN) .setTitle("All Warnings Removed") - .setDescription("All of ``" + user.getAsTag() + "``'s warnings have been removed!") + .setDescription("All of ``" + user.getName() + "``'s warnings have been removed!") .setTimestamp(Instant.now()) .setFooter("User ID: " + user.getId(), user.getEffectiveAvatarUrl()) .build(); diff --git a/src/listener/java/com/mcmoddev/mmdbot/thelistener/events/RoleEvents.java b/src/listener/java/com/mcmoddev/mmdbot/thelistener/events/RoleEvents.java index b611420b..2ff36aad 100644 --- a/src/listener/java/com/mcmoddev/mmdbot/thelistener/events/RoleEvents.java +++ b/src/listener/java/com/mcmoddev/mmdbot/thelistener/events/RoleEvents.java @@ -127,7 +127,7 @@ private static void buildAndSendMessage(AuditLogEntry entry, Member target, Stri embed.setTitle("User Role(s) " + changeType) .setColor(Color.YELLOW) - .addField("User:", target.getUser().getAsTag(), true) + .addField("User:", target.getUser().getName(), true) .setFooter("User ID: " + target.getUser().getId(), target.getEffectiveAvatarUrl()) .setTimestamp(entry.getTimeCreated()); @@ -138,7 +138,7 @@ private static void buildAndSendMessage(AuditLogEntry entry, Member target, Stri }) .queue(editor -> { if (editor != null) { - embed.addField("Editor:", editor.getAsTag(), true); + embed.addField("Editor:", editor.getName(), true); } embed.addField("Previous Role(s):", mentionsOrEmpty(previousRoles), true) diff --git a/src/watcher/java/com/mcmoddev/mmdbot/watcher/commands/moderation/BanCommand.java b/src/watcher/java/com/mcmoddev/mmdbot/watcher/commands/moderation/BanCommand.java index 6db1d5c3..e385148d 100644 --- a/src/watcher/java/com/mcmoddev/mmdbot/watcher/commands/moderation/BanCommand.java +++ b/src/watcher/java/com/mcmoddev/mmdbot/watcher/commands/moderation/BanCommand.java @@ -77,7 +77,7 @@ protected void execute(final CommandEvent event) { final String banReason; if (!(args.length > 1)) { banReason = "Reason for ban could not be found or was not provided, please contact " - + event.getMember().getUser().getAsTag() + " - (" + event.getMember().getId() + ")"; + + event.getMember().getUser().getName() + " - (" + event.getMember().getId() + ")"; } else { banReason = event.getArgs().substring(args[0].length() + 1); } @@ -98,7 +98,7 @@ protected void execute(final CommandEvent event) { unit = TimeUnit.MINUTES; } - final String auditReason = "Ban issued by " + event.getAuthor().getAsTag() + ": " + banReason; + final String auditReason = "Ban issued by " + event.getAuthor().getName() + ": " + banReason; if (!event.getArgs().contains("-d")) { event.getGuild().ban(member, 0, TimeUnit.DAYS).reason(auditReason).queue(); } else { diff --git a/src/watcher/java/com/mcmoddev/mmdbot/watcher/commands/moderation/KickCommand.java b/src/watcher/java/com/mcmoddev/mmdbot/watcher/commands/moderation/KickCommand.java index 9dce69db..c42a842d 100644 --- a/src/watcher/java/com/mcmoddev/mmdbot/watcher/commands/moderation/KickCommand.java +++ b/src/watcher/java/com/mcmoddev/mmdbot/watcher/commands/moderation/KickCommand.java @@ -76,7 +76,7 @@ protected void execute(final CommandEvent event) { final String kickReason; if (!mentioned && !(args.length > 1)) { kickReason = "Reason for kick could not be found or was not provided, please contact " - + author.getUser().getAsTag() + " - (" + author.getId() + ")"; + + author.getUser().getName() + " - (" + author.getId() + ")"; } else { kickReason = mentioned ? event.getArgs() : event.getArgs().substring(args[0].length() + 1); } diff --git a/src/watcher/java/com/mcmoddev/mmdbot/watcher/commands/moderation/UnmuteCommand.java b/src/watcher/java/com/mcmoddev/mmdbot/watcher/commands/moderation/UnmuteCommand.java index 13cc724f..61e50b0d 100644 --- a/src/watcher/java/com/mcmoddev/mmdbot/watcher/commands/moderation/UnmuteCommand.java +++ b/src/watcher/java/com/mcmoddev/mmdbot/watcher/commands/moderation/UnmuteCommand.java @@ -91,7 +91,7 @@ protected void execute(final SlashCommandEvent event) { return; } - guild.removeTimeout(user).reason("Timeout removed at the request of " + event.getUser().getAsTag()).queue(); + guild.removeTimeout(user).reason("Timeout removed at the request of " + event.getUser().getName()).queue(); final var muteEmbed = new EmbedBuilder().setColor(Color.DARK_GRAY) .setTitle(user.getEffectiveName() + " has been un-muted!").setTimestamp(Instant.now()) diff --git a/src/watcher/java/com/mcmoddev/mmdbot/watcher/commands/moderation/WarningCommand.java b/src/watcher/java/com/mcmoddev/mmdbot/watcher/commands/moderation/WarningCommand.java index 2aa6f64f..e15883d9 100644 --- a/src/watcher/java/com/mcmoddev/mmdbot/watcher/commands/moderation/WarningCommand.java +++ b/src/watcher/java/com/mcmoddev/mmdbot/watcher/commands/moderation/WarningCommand.java @@ -285,7 +285,7 @@ public void onAutoComplete(final CommandAutoCompleteInteractionEvent event) { .limit(5) .map(id -> { final var targetMember = event.getJDA().getUserById(WarningCommand.withExtension(db -> db.getUser(id))); - return new Command.Choice(id + (targetMember == null ? "" : (" - " + targetMember.getAsTag())), id); + return new Command.Choice(id + (targetMember == null ? "" : (" - " + targetMember.getName())), id); }).toList()).queue(); } } diff --git a/src/watcher/java/com/mcmoddev/mmdbot/watcher/event/EventReactionAdded.java b/src/watcher/java/com/mcmoddev/mmdbot/watcher/event/EventReactionAdded.java index 4fb8e1c0..92480d90 100644 --- a/src/watcher/java/com/mcmoddev/mmdbot/watcher/event/EventReactionAdded.java +++ b/src/watcher/java/com/mcmoddev/mmdbot/watcher/event/EventReactionAdded.java @@ -157,7 +157,7 @@ public void onMessageReactionAdd(final MessageReactionAddEvent event) { WEBHOOKS.getWebhook(logChannel) .send(Utils.webhookMessage(builder.build()) - .setUsername(messageAuthor.getAsTag()) + .setUsername(messageAuthor.getName()) .setAvatarUrl(messageAuthor.getEffectiveAvatarUrl()) .build()); } @@ -187,7 +187,7 @@ public void onMessageReactionAdd(final MessageReactionAddEvent event) { .appendDescription(", and has been approved by moderators for deletion."); final String approvingMods = signedOffStaff.stream() - .map(s -> "%s (%s, id `%s`)".formatted(s.getAsMention(), s.getUser().getAsTag(), s.getId())) + .map(s -> "%s (%s, id `%s`)".formatted(s.getAsMention(), s.getUser().getName(), s.getId())) .collect(Collectors.joining("\n")); builder.addField("Approving moderators", approvingMods, true); @@ -199,7 +199,7 @@ public void onMessageReactionAdd(final MessageReactionAddEvent event) { .send(Utils.webhookMessage(builder.build()) .setContent(message.getContentRaw()) .setAvatarUrl(messageAuthor.getEffectiveAvatarUrl()) - .setUsername(messageAuthor.getAsTag()) + .setUsername(messageAuthor.getName()) .build()); }