Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import org.togetherjava.tjbot.commands.moderation.scam.ScamHistoryPurgeRoutine;
import org.togetherjava.tjbot.commands.moderation.scam.ScamHistoryStore;
import org.togetherjava.tjbot.commands.moderation.temp.TemporaryModerationRoutine;
import org.togetherjava.tjbot.commands.reminder.RemindCommand;
import org.togetherjava.tjbot.commands.reminder.RemindRoutine;
import org.togetherjava.tjbot.commands.reminder.ReminderCommand;
import org.togetherjava.tjbot.commands.system.BotCore;
import org.togetherjava.tjbot.commands.system.LogLevelCommand;
import org.togetherjava.tjbot.commands.tags.TagCommand;
Expand Down Expand Up @@ -120,7 +120,7 @@ public static Collection<Feature> createFeatures(JDA jda, Database database, Con
features.add(new TopHelpersCommand(database));
features.add(new RoleSelectCommand());
features.add(new NoteCommand(actionsStore));
features.add(new RemindCommand(database));
features.add(new ReminderCommand(database));
features.add(new QuarantineCommand(actionsStore, config));
features.add(new UnquarantineCommand(actionsStore, config));
features.add(new WhoIsCommand());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import org.togetherjava.tjbot.commands.CommandVisibility;
import org.togetherjava.tjbot.commands.SlashCommandAdapter;
import org.togetherjava.tjbot.commands.utils.Pagination;

import javax.annotation.Nullable;

Expand Down Expand Up @@ -106,7 +107,7 @@ private <R extends MessageRequest<R>> RestAction<R> auditUser(
if (pageNumber == -1) {
pageNumberInLimits = totalPages;
} else {
pageNumberInLimits = clamp(1, pageNumber, totalPages);
pageNumberInLimits = Pagination.clamp(1, pageNumber, totalPages);
}

return jda.retrieveUserById(targetId)
Expand All @@ -130,10 +131,6 @@ private List<List<ActionRecord>> groupActionsByPages(List<ActionRecord> actions)
return groupedActions;
}

private static int clamp(int minInclusive, int value, int maxInclusive) {
return Math.min(Math.max(minInclusive, value), maxInclusive);
}

private static EmbedBuilder createSummaryEmbed(User user, Collection<ActionRecord> actions) {
return new EmbedBuilder().setTitle("Audit log of **%s**".formatted(user.getAsTag()))
.setAuthor(user.getName(), null, user.getAvatarUrl())
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
/**
* Routine that processes and sends pending reminders.
* <p>
* Reminders can be set by using {@link RemindCommand}.
* Reminders can be set by using {@link ReminderCommand}.
*/
public final class RemindRoutine implements Routine {
static final Logger logger = LoggerFactory.getLogger(RemindRoutine.class);
private static final Color AMBIENT_COLOR = Color.decode("#F7F492");
static final Color AMBIENT_COLOR = Color.decode("#F7F492");
private static final int SCHEDULE_INTERVAL_SECONDS = 30;
private final Database database;

Expand Down
Loading