3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-15 14:15:03 +00:00

Fixes, refactoring and PR feedback

This commit is contained in:
Lily Bergonzat 2024-04-15 15:51:45 +02:00
parent 0be54912c4
commit 893a77d562
202 changed files with 1037 additions and 1069 deletions

View file

@ -38,7 +38,7 @@ export const RemindCmd = remindersCmd({
// "Delay string" i.e. e.g. "2h30m"
const ms = convertDelayStringToMS(args.time);
if (ms === null) {
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, "Invalid reminder time");
void pluginData.state.common.sendErrorMessage(msg, "Invalid reminder time");
return;
}
@ -46,7 +46,7 @@ export const RemindCmd = remindersCmd({
}
if (!reminderTime.isValid() || reminderTime.isBefore(now)) {
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, "Invalid reminder time");
void pluginData.state.common.sendErrorMessage(msg, "Invalid reminder time");
return;
}
@ -67,8 +67,6 @@ export const RemindCmd = remindersCmd({
pluginData.getPlugin(TimeAndDatePlugin).getDateFormat("pretty_datetime"),
);
pluginData
.getPlugin(CommonPlugin)
.sendSuccessMessage(msg, `I will remind you in **${timeUntilReminder}** at **${prettyReminderTime}**`);
void pluginData.state.common.sendSuccessMessage(msg, `I will remind you in **${timeUntilReminder}** at **${prettyReminderTime}**`);
},
});

View file

@ -12,7 +12,7 @@ export const RemindersCmd = remindersCmd({
async run({ message: msg, pluginData }) {
const reminders = await pluginData.state.reminders.getRemindersByUserId(msg.author.id);
if (reminders.length === 0) {
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, "No reminders");
void pluginData.state.common.sendErrorMessage(msg, "No reminders");
return;
}

View file

@ -17,7 +17,7 @@ export const RemindersDeleteCmd = remindersCmd({
reminders.sort(sorter("remind_at"));
if (args.num > reminders.length || args.num <= 0) {
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, "Unknown reminder");
void pluginData.state.common.sendErrorMessage(msg, "Unknown reminder");
return;
}
@ -25,6 +25,6 @@ export const RemindersDeleteCmd = remindersCmd({
clearUpcomingReminder(toDelete);
await pluginData.state.reminders.delete(toDelete.id);
pluginData.getPlugin(CommonPlugin).sendSuccessMessage(msg, "Reminder deleted");
void pluginData.state.common.sendSuccessMessage(msg, "Reminder deleted");
},
});