aboutsummaryrefslogtreecommitdiff
path: root/src/commands/utilities/reminders.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/utilities/reminders.ts')
-rw-r--r--src/commands/utilities/reminders.ts23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/commands/utilities/reminders.ts b/src/commands/utilities/reminders.ts
index 79284ac..18243fe 100644
--- a/src/commands/utilities/reminders.ts
+++ b/src/commands/utilities/reminders.ts
@@ -1,4 +1,15 @@
-import { BushCommand, ButtonPaginator, Reminder, type CommandMessage, type SlashMessage } from '#lib';
+import {
+ BushCommand,
+ ButtonPaginator,
+ chunk,
+ clientSendAndPermCheck,
+ colors,
+ emojis,
+ Reminder,
+ timestamp,
+ type CommandMessage,
+ type SlashMessage
+} from '#lib';
import assert from 'assert';
import { PermissionFlagsBits, type APIEmbed } from 'discord.js';
import { Op } from 'sequelize';
@@ -14,22 +25,22 @@ export default class RemindersCommand extends BushCommand {
usage: ['reminder'],
examples: ['reminders'],
slash: true,
- clientPermissions: (m) => util.clientSendAndPermCheck(m, [PermissionFlagsBits.EmbedLinks]),
+ clientPermissions: (m) => clientSendAndPermCheck(m, [PermissionFlagsBits.EmbedLinks]),
userPermissions: []
});
}
public override async exec(message: CommandMessage | SlashMessage) {
const reminders = await Reminder.findAll({ where: { user: message.author.id, expires: { [Op.gt]: new Date() } } });
- if (!reminders.length) return message.util.send(`${util.emojis.error} You don't have any reminders set.`);
+ if (!reminders.length) return message.util.send(`${emojis.error} You don't have any reminders set.`);
- const formattedReminders = reminders.map((reminder) => `${util.timestamp(reminder.expires, 't')} - ${reminder.content}`);
+ const formattedReminders = reminders.map((reminder) => `${timestamp(reminder.expires, 't')} - ${reminder.content}`);
- const chunked = util.chunk(formattedReminders, 15);
+ const chunked = chunk(formattedReminders, 15);
const embeds: APIEmbed[] = chunked.map((chunk) => ({
title: `Reminders`,
description: chunk.join('\n'),
- color: util.colors.default
+ color: colors.default
}));
return await ButtonPaginator.send(message, embeds);
}