3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Type fixes for djs

This commit is contained in:
Dark 2021-06-30 04:56:56 +02:00
parent 653d6c1dc2
commit 0822fc15e5
No known key found for this signature in database
GPG key ID: 2CD6ACB6B0A87B8A
130 changed files with 8877 additions and 411 deletions

View file

@ -1,4 +1,4 @@
import { TextChannel } from "discord.js";
import { Snowflake, TextChannel } from "discord.js";
import humanizeDuration from "humanize-duration";
import { GuildPluginData } from "knub";
import { disableLinkPreviews } from "knub/dist/helpers";
@ -12,7 +12,7 @@ const MAX_TRIES = 3;
export async function postDueRemindersLoop(pluginData: GuildPluginData<RemindersPluginType>) {
const pendingReminders = await pluginData.state.reminders.getDueReminders();
for (const reminder of pendingReminders) {
const channel = pluginData.guild.channels.cache.get(reminder.channel_id);
const channel = pluginData.guild.channels.cache.get(reminder.channel_id as Snowflake);
if (channel && channel instanceof TextChannel) {
try {
// Only show created at date if one exists
@ -25,14 +25,14 @@ export async function postDueRemindersLoop(pluginData: GuildPluginData<Reminders
`Reminder for <@!${reminder.user_id}>: ${reminder.body} \n\`Set at ${reminder.created_at} (${result} ago)\``,
),
allowedMentions: {
users: [reminder.user_id],
users: [reminder.user_id as Snowflake],
},
});
} else {
await channel.send({
content: disableLinkPreviews(`Reminder for <@!${reminder.user_id}>: ${reminder.body}`),
allowedMentions: {
users: [reminder.user_id],
users: [reminder.user_id as Snowflake],
},
});
}