feat: delete message id when title no longer airing

This commit is contained in:
2024-09-19 15:31:14 -04:00
parent 027e8eaac5
commit 1ce79ed17a
4 changed files with 34 additions and 11 deletions

View File

@@ -5,6 +5,7 @@ import { setTitleMessage } from "~/models/titleMessages";
import type { Env } from "~/types/env";
import { getNextEpisodeTimeUntilAiring } from "./anilist/getNextEpisodeAiringAt";
import { deleteMessageIdForTitle } from "./deleteMessageIdForTitle";
import { getCurrentDomain } from "./getCurrentDomain";
export async function maybeScheduleNextAiringEpisode(
@@ -14,6 +15,7 @@ export async function maybeScheduleNextAiringEpisode(
) {
const nextAiring = await getNextEpisodeTimeUntilAiring(aniListId);
if (!nextAiring) {
await deleteMessageIdForTitle(env, aniListId);
return;
}