Skip to content

Commit

Permalink
fixed notification list cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Jan 30, 2021
1 parent 4646b4e commit 5d53e45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void run(Options options, CommandContext ctx){
var pages = new ArrayList<String>();

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();
Expand All @@ -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(),
Expand All @@ -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())
);
));
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -22,8 +20,6 @@

public class NotificationModule extends Module{

private static final Logger LOG = LoggerFactory.getLogger(NotificationModule.class);

private Map<Long, Notification> notifications;

@Override
Expand Down

0 comments on commit 5d53e45

Please sign in to comment.