Skip to content

Commit

Permalink
Update: morning update message should indicate when theres no episodes
Browse files Browse the repository at this point in the history
coming
  • Loading branch information
cbackas committed Jul 19, 2023
1 parent 24085c8 commit 1e10e48
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/lib/upcoming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,22 @@ export async function getUpcomingEpisodesMessage (shows: Show[], days: number =
export async function getUpcomingEpisodesEmbed (shows: Show[], days: number = 1): Promise<APIEmbed> {
const messages = await getShowMessages(shows, days)

const footer: APIEmbed['footer'] = {
text: 'Powered by TVDB',
icon_url: 'https://www.thetvdb.com/images/logo.png'
}

if (messages.messages.length === 0) {
return {
title: messages.empty,
footer
}
}

return {
title: messages.prefix,
fields: messages.embedFields,
footer: {
text: 'Powered by TVDB',
icon_url: 'https://www.thetvdb.com/images/logo.png'
}
footer
}
}

Expand Down

0 comments on commit 1e10e48

Please sign in to comment.