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

Add allowed mentions back for reminders

This commit is contained in:
Dragory 2021-04-10 23:39:23 +03:00
parent 7a1779b43c
commit e0a659be4a
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -20,13 +20,21 @@ export async function postDueRemindersLoop(pluginData: GuildPluginData<Reminders
const target = moment.utc();
const diff = target.diff(moment.utc(reminder.created_at, "YYYY-MM-DD HH:mm:ss"));
const result = humanizeDuration(diff, { largest: 2, round: true });
await channel.createMessage(
disableLinkPreviews(
await channel.createMessage({
content: disableLinkPreviews(
`Reminder for <@!${reminder.user_id}>: ${reminder.body} \n\`Set at ${reminder.created_at} (${result} ago)\``,
),
);
allowedMentions: {
users: [reminder.user_id],
},
});
} else {
await channel.createMessage(disableLinkPreviews(`Reminder for <@!${reminder.user_id}>: ${reminder.body}`));
await channel.createMessage({
content: disableLinkPreviews(`Reminder for <@!${reminder.user_id}>: ${reminder.body}`),
allowedMentions: {
users: [reminder.user_id],
},
});
}
} catch (e) {
// Probably random Discord internal server error or missing permissions or somesuch