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 2593f92dad - Show all commits

View file

@ -24,7 +24,7 @@ export default async (client: Client) => {
const info = {
locale: element.locale,
message: element.data,
createdAt: element.creation_date,
createdAt: Number(element.creation_date),
channelId: `${element.channel_id}`,
userId: `${element.user_id}`,
guildId: `${element.guild_id}`,
@ -32,7 +32,7 @@ export default async (client: Client) => {
if (element.expiration_date <= now) {
// Reminder expired
deleteReminder(client, element.creation_date, `${element.user_id}`).then((res) => {
deleteReminder(client, Number(element.creation_date), `${element.user_id}`).then((res) => {
if (res != true) {
throw res;
}
@ -44,7 +44,7 @@ export default async (client: Client) => {
const timeoutId = setTimeoutReminder(client, info, element.option_id, (element.expiration_date - now) / 1000);
// Update timeout in database
element.timeout_id = timeoutId;
element.timeout_id = String(timeoutId);
updateReminder(client, element).then((res) => {
if (res != true) {
throw res;