feat: more readable time delta #193
3 changed files with 6 additions and 4 deletions
|
@ -60,7 +60,7 @@
|
|||
"c_reminder_sub3_desc": "Delete a reminder",
|
||||
"c_reminder_sub3_opt1_name": "id",
|
||||
"c_reminder_sub3_opt1_desc": "Reminder to be deleted",
|
||||
"c_reminder1": "A reminder has been set up for in",
|
||||
"c_reminder1": "A reminder has been set up for",
|
||||
"c_reminder2": "The ID entered is not valid.",
|
||||
"c_reminder3": "Reminder not found, not in the right guild, or not belonging to you.",
|
||||
"c_reminder4": "Unknown user.",
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
"c_reminder_sub3_desc": "Supprime un rappel",
|
||||
"c_reminder_sub3_opt1_name": "id",
|
||||
"c_reminder_sub3_opt1_desc": "Rappel à supprimé",
|
||||
"c_reminder1": "Un rappel a été configuré pour dans",
|
||||
"c_reminder1": "Un rappel a été configuré pour",
|
||||
"c_reminder2": "L'ID renseigné n'est pas valide.",
|
||||
"c_reminder3": "Rappel non trouvé, pas sur le bon serveur ou qui ne vous appartiens pas.",
|
||||
"c_reminder4": "Utilisateur inconnu.",
|
||||
|
|
|
@ -88,6 +88,8 @@ export const newReminder = async (client: Client, time: string, info: infoRemind
|
|||
|
||||
const timeoutId = setTimeoutReminder(client, info, data.option, timeout);
|
||||
|
||||
const expiration_date = info.createdAt + timeout * 1000;
|
||||
|
||||
// Add the remind to the db
|
||||
client.db.run(
|
||||
"INSERT INTO reminder ( \
|
||||
|
@ -95,7 +97,7 @@ export const newReminder = async (client: Client, time: string, info: infoRemind
|
|||
) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ? );",
|
||||
[
|
||||
info.message,
|
||||
`${info.createdAt + timeout * 1000}`,
|
||||
`${expiration_date}`,
|
||||
data.option.valueOf(),
|
||||
info.channelId,
|
||||
`${info.createdAt}`,
|
||||
|
@ -110,7 +112,7 @@ export const newReminder = async (client: Client, time: string, info: infoRemind
|
|||
}
|
||||
|
||||
// Send confirmation to user
|
||||
ok(`${loc.get("c_reminder1")} ${data.time}.`);
|
||||
ok(`${loc.get("c_reminder1")} ${timeDeltaToString(info.locale, expiration_date)}.`);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue