diff --git a/module/mcversion/src/main/java/net/fabricmc/discord/bot/module/mcversion/LauncherNewsFetcher.java b/module/mcversion/src/main/java/net/fabricmc/discord/bot/module/mcversion/LauncherNewsFetcher.java index ed9dd53..5d0ea46 100644 --- a/module/mcversion/src/main/java/net/fabricmc/discord/bot/module/mcversion/LauncherNewsFetcher.java +++ b/module/mcversion/src/main/java/net/fabricmc/discord/bot/module/mcversion/LauncherNewsFetcher.java @@ -213,7 +213,7 @@ private boolean announce(Version version) { } record Version(String type, String name, String title, @Nullable URI image, String shortText, ZonedDateTime date) implements Comparable { - private static final String URL_PREFIX = "https://www.minecraft.net/en-us/article/minecraft"; + private static final String URL_PREFIX = "https://www.minecraft.net/en-us/article"; private static final Predicate SNAPSHOT_PREDICATE = Pattern.compile("^\\d+w\\d+[a-z]+$").asMatchPredicate(); private static final Pattern NON_ALPHANUMERIC = Pattern.compile("[^a-z0-9]"); @@ -230,11 +230,11 @@ EmbedBuilder toEmbed() { String getUrl() { if ("release".equals(type)) { - return "%s-java-edition-%s".formatted(URL_PREFIX, name.replace('.', '-')); + return "%s/minecraft-java-edition-%s".formatted(URL_PREFIX, name.replace('.', '-')); } else if (SNAPSHOT_PREDICATE.test(name)) { - return "%s-snapshot-%s".formatted(URL_PREFIX, name); + return "%s/minecraft-snapshot-%s".formatted(URL_PREFIX, name); } else { - return "%s-%s".formatted(URL_PREFIX, NON_ALPHANUMERIC.matcher(name.toLowerCase(Locale.ROOT)).replaceAll("-")); + return "%s/%s".formatted(URL_PREFIX, NON_ALPHANUMERIC.matcher(title.toLowerCase(Locale.ROOT)).replaceAll("-")); } }