Skip to content

Commit 41829f8

Browse files
nltbeeZabuzard
authored andcommitted
Made remindme command's implementation global to MessageChannel
1 parent bae7b79 commit 41829f8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

application/src/main/java/org/togetherjava/tjbot/commands/reminder/RemindRoutine.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ private static void sendReminder(@NotNull JDA jda, long id, long channelId, long
7171
private static RestAction<ReminderRoute> computeReminderRoute(@NotNull JDA jda, long channelId,
7272
long authorId) {
7373
// If guild channel can still be found, send there
74-
TextChannel channel = jda.getTextChannelById(channelId);
74+
MessageChannel channel = jda.getChannelById(MessageChannel.class, channelId);
7575
if (channel != null) {
7676
return createGuildReminderRoute(jda, authorId, channel);
7777
}
@@ -81,7 +81,7 @@ private static RestAction<ReminderRoute> computeReminderRoute(@NotNull JDA jda,
8181
}
8282

8383
private static @NotNull RestAction<ReminderRoute> createGuildReminderRoute(@NotNull JDA jda,
84-
long authorId, @NotNull TextChannel channel) {
84+
long authorId, @NotNull MessageChannel channel) {
8585
return jda.retrieveUserById(authorId)
8686
.onErrorMap(error -> null)
8787
.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
128128

129129
private record ReminderRoute(@NotNull MessageChannel channel, @Nullable User target,
130130
@Nullable String description) {
131-
static ReminderRoute toPublic(@NotNull TextChannel channel, @Nullable User target) {
131+
static ReminderRoute toPublic(@NotNull MessageChannel channel, @Nullable User target) {
132132
return new ReminderRoute(channel, target,
133133
target == null ? null : target.getAsMention());
134134
}

0 commit comments

Comments
 (0)