feat: Reminders #44

Merged
Anri merged 54 commits from feat/reminders into main 2023-01-17 12:15:15 +01:00
Showing only changes of commit 240b0d0422 - Show all commits

View file

@ -281,11 +281,10 @@ export const embedListReminders = async (client: Client, user: User, guildId: st
const reminders = await listReminders(client, user.id, guildId);
const elementPerPage = 5;
let pageMax = Math.floor(reminders.length / elementPerPage);
const pageMax = Math.ceil(reminders.length / elementPerPage);
if (pageMax <= 1) {
page = 1;
pageMax = 1;
}
const embed = new EmbedBuilder()
.setColor(Colors.DarkGrey)
@ -295,9 +294,10 @@ export const embedListReminders = async (client: Client, user: User, guildId: st
const limit = elementPerPage * page;
if (reminders.length > 0 && page <= pageMax) {
let curseur = limit - elementPerPage - 1;
let curseur = limit - elementPerPage;
reminders.splice(0, limit - elementPerPage);
reminders.forEach((remind) => {
if (curseur <= limit) {
if (curseur < limit) {
let text = remind.data ?? loc.get('c_reminder7');
if (text.length > 1024) {
text = `${text.substring(0, 1021)}...`;