From 2dcfc1a139dfd730041ce478eda031ec7edc238c Mon Sep 17 00:00:00 2001 From: nltbee Date: Tue, 29 Mar 2022 15:03:41 +0200 Subject: [PATCH] Made remindme command's implementation global to MessageChannel --- .../togetherjava/tjbot/commands/reminder/RemindRoutine.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/src/main/java/org/togetherjava/tjbot/commands/reminder/RemindRoutine.java b/application/src/main/java/org/togetherjava/tjbot/commands/reminder/RemindRoutine.java index 4e0e167b42..e232ae1519 100644 --- a/application/src/main/java/org/togetherjava/tjbot/commands/reminder/RemindRoutine.java +++ b/application/src/main/java/org/togetherjava/tjbot/commands/reminder/RemindRoutine.java @@ -71,7 +71,7 @@ private static void sendReminder(@NotNull JDA jda, long id, long channelId, long private static RestAction computeReminderRoute(@NotNull JDA jda, long channelId, long authorId) { // If guild channel can still be found, send there - TextChannel channel = jda.getTextChannelById(channelId); + MessageChannel channel = jda.getChannelById(MessageChannel.class, channelId); if (channel != null) { return createGuildReminderRoute(jda, authorId, channel); } @@ -81,7 +81,7 @@ private static RestAction computeReminderRoute(@NotNull JDA jda, } private static @NotNull RestAction createGuildReminderRoute(@NotNull JDA jda, - long authorId, @NotNull TextChannel channel) { + long authorId, @NotNull MessageChannel channel) { return jda.retrieveUserById(authorId) .onErrorMap(error -> null) .map(author -> ReminderRoute.toPublic(channel, author)); @@ -128,7 +128,7 @@ Failed to send a reminder (id '{}'), skipping it. This can be due to a network i private record ReminderRoute(@NotNull MessageChannel channel, @Nullable User target, @Nullable String description) { - static ReminderRoute toPublic(@NotNull TextChannel channel, @Nullable User target) { + static ReminderRoute toPublic(@NotNull MessageChannel channel, @Nullable User target) { return new ReminderRoute(channel, target, target == null ? null : target.getAsMention()); }