diff options
author | 2019-12-04 15:13:11 +0100 | |
---|---|---|
committer | 2019-12-04 15:20:48 +0100 | |
commit | 62fe183ce6d499f6b2129b91a35fd9d6f2632d3f (patch) | |
tree | f21aaa356a6dca4545f69e7ca95baa617f9afaa1 /bot/bot.py | |
parent | Make AoC channel ID configurable for testing environments (diff) |
Unlock AoC role to make announcements actually ping the users
The Advent of Code cog has a subscription system that allows members
to subscribe to a daily notification indicating the puzzle for that
day has become available. However, we introduces a more stringent
role mentionability policy that meant that the mentions did not
actually ping the members subscribed.
To solve this, I've made sure that the bot unlocks the role before
making the announcement using the `unlock_role` context manager. This
also means the role is automatically unlocked after the message is
sent.
In addition, I noticed that Seasonalbot was consistently announcing
the puzzle about 0.5 seconds early. I've correct this by adding a
second to the sleep delay. In addition, the bot now verifies that the
puzzle is available using a small HEAD request. While this does send
a request to the AoC server, it prevents multiple users from sending
unnecessary requests by following our link before the puzzle is
actually available.
Diffstat (limited to 'bot/bot.py')
0 files changed, 0 insertions, 0 deletions