UQComputingSociety / uqcsbot-slack

:mortar_board: UQCSbot: our friendly little Slack bot
https://slack.uqcs.org.au
MIT License
55 stars 44 forks source link

Avoid duplications in !xkcd #557

Open nicklambourne opened 4 years ago

nicklambourne commented 4 years ago

When xkcd skips a day or is late our bot reposts the last comic, leading to duplication and groaning.

Fix by storing the most recently published comic number in the postgres DB and querying it before posting. If the number exists, don't post that day. This should also help us be more up to date as we can check more regularly against the stored number than we have based solely on cron.