feat: delete message id when title no longer airing
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user