diff --git a/src/main/java/de/kittybot/kittybot/commands/notification/NotificationCommand.java b/src/main/java/de/kittybot/kittybot/commands/notification/NotificationCommand.java index ef70affc..856cb7b9 100644 --- a/src/main/java/de/kittybot/kittybot/commands/notification/NotificationCommand.java +++ b/src/main/java/de/kittybot/kittybot/commands/notification/NotificationCommand.java @@ -108,7 +108,7 @@ public void run(Options options, CommandContext ctx){ var pages = new ArrayList(); for(var notif : notifs){ - var formattedNotif = notifMessage.append("**").append(notif.getId()).append("**").append(" scheduled for `").append(TimeUtils.format(notif.getNotificationTime())).append("`").append("\n") + "\n"; + var formattedNotif = "**" + notif.getId() + "**" + " scheduled for `" + TimeUtils.format(notif.getNotificationTime()) + "`" + "\n" + "\n"; if(notifMessage.length() + formattedNotif.length() >= 2048){ pages.add(notifMessage.toString()); notifMessage = new StringBuilder(); @@ -117,8 +117,7 @@ public void run(Options options, CommandContext ctx){ } pages.add(notifMessage.toString()); - ctx.sendAcknowledge(true); - ctx.get(PaginatorModule.class).create( + ctx.acknowledge(true).queue(success -> ctx.get(PaginatorModule.class).create( ctx.getChannel(), ctx.getUserId(), pages.size(), @@ -127,7 +126,7 @@ public void run(Options options, CommandContext ctx){ .setAuthor("Your Notifications", Config.ORIGIN_URL, Category.NOTIFICATION.getEmoteUrl()) .setDescription(pages.get(page)) .setTimestamp(Instant.now()) - ); + )); } } diff --git a/src/main/java/de/kittybot/kittybot/modules/NotificationModule.java b/src/main/java/de/kittybot/kittybot/modules/NotificationModule.java index 2e857b98..501b91d9 100644 --- a/src/main/java/de/kittybot/kittybot/modules/NotificationModule.java +++ b/src/main/java/de/kittybot/kittybot/modules/NotificationModule.java @@ -8,8 +8,6 @@ import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.events.ReadyEvent; import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.time.Instant; import java.time.LocalDateTime; @@ -22,8 +20,6 @@ public class NotificationModule extends Module{ - private static final Logger LOG = LoggerFactory.getLogger(NotificationModule.class); - private Map notifications; @Override