Skip to content

Commit

Permalink
Added logging for holidays cog
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesDearlove committed Oct 15, 2023
1 parent cd5b338 commit 0acbe97
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions uqcsbot/holidays.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ def get_holidays_from_page(holiday_page: str) -> List[Holiday]:
holiday = Holiday(date, description, url)
holidays.append(holiday)

if holidays == []:
logging.warn("Failed to get holidays from page.")

return holidays


Expand Down Expand Up @@ -113,8 +116,11 @@ async def holiday(self):
Posts a random celebratory day on #general from
https://www.timeanddate.com/holidays/fun/
"""
logging.info("Running daily holiday task")

holiday = get_holiday()
if holiday is None:
logging.info("No holiday was found for today")
return

general_channel = discord.utils.get(
Expand Down

0 comments on commit 0acbe97

Please sign in to comment.