a4p-bot/src/modules/reminders/sendUnfinsihedDistros.ts
Naomi a85b478dba feat: migrate away from trello (#2)
Closes #1

Reviewed-on: https://codeberg.org/nhcarrigan/a4p-bot/pulls/2
Co-authored-by: Naomi <commits@nhcarrigan.com>
Co-committed-by: Naomi <commits@nhcarrigan.com>
2024-05-21 05:11:11 +00:00

26 lines
906 B
TypeScript

import { TextChannel } from "discord.js";
import { ExtendedClient } from "../../interface/ExtendedClient";
/**
* Sends a reminder to finish claimed distribution requests.
*
* @param {ExtendedClient} bot The bot's Discord instance.
*/
export const sendUnfinishedDistros = async (bot: ExtendedClient) => {
try {
const guild = await bot.guilds.fetch("1172566005311090798");
const channel = (await guild.channels.fetch(
"1173061747737903315"
)) as TextChannel;
const threads = await channel.threads.fetchActive();
for (const thread of threads.threads.values()) {
await thread.send({
content: `<@!${thread.name}>, this distribution appears unconfirmed. When it's complete, please upload a confirmation image here and the thread will be processed.`,
});
}
} catch (err) {
await bot.debug.send(`Cannot send unfinished art reminder: ${err}`);
}
};