feat: Reminders #44
1 changed files with 3 additions and 3 deletions
|
@ -24,7 +24,7 @@ export default async (client: Client) => {
|
||||||
const info = {
|
const info = {
|
||||||
locale: element.locale,
|
locale: element.locale,
|
||||||
message: element.data,
|
message: element.data,
|
||||||
createdAt: element.creation_date,
|
createdAt: Number(element.creation_date),
|
||||||
channelId: `${element.channel_id}`,
|
channelId: `${element.channel_id}`,
|
||||||
userId: `${element.user_id}`,
|
userId: `${element.user_id}`,
|
||||||
guildId: `${element.guild_id}`,
|
guildId: `${element.guild_id}`,
|
||||||
|
@ -32,7 +32,7 @@ export default async (client: Client) => {
|
||||||
|
|
||||||
if (element.expiration_date <= now) {
|
if (element.expiration_date <= now) {
|
||||||
// Reminder expired
|
// 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) {
|
if (res != true) {
|
||||||
throw res;
|
throw res;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ export default async (client: Client) => {
|
||||||
const timeoutId = setTimeoutReminder(client, info, element.option_id, (element.expiration_date - now) / 1000);
|
const timeoutId = setTimeoutReminder(client, info, element.option_id, (element.expiration_date - now) / 1000);
|
||||||
|
|
||||||
// Update timeout in database
|
// Update timeout in database
|
||||||
element.timeout_id = timeoutId;
|
element.timeout_id = String(timeoutId);
|
||||||
updateReminder(client, element).then((res) => {
|
updateReminder(client, element).then((res) => {
|
||||||
if (res != true) {
|
if (res != true) {
|
||||||
throw res;
|
throw res;
|
||||||
|
|
Loading…
Reference in a new issue