python-discord / sir-robin

Our event bot, for managing community events.
MIT License
18 stars 14 forks source link

Command to toggle issuing AoC completionist #112

Closed ChrisLovering closed 5 months ago

ChrisLovering commented 6 months ago

Labeled as DO NOT MERGE as I will need to migrate redis caches to the new namespaces before merging this.

This adds a new command, and redis cache, to control whether the AoC completionist role is issued.

This also refactors the cog a little it while I was there. As usual, this PR is best reviewed commit-by-commit.

ChrisLovering commented 5 months ago

If the role from the loaded in config can't be found, then the &aoc ct to do the initial toggle-on fails. I think it would be better to output the error somewhere visible for admins/the Event Runner to see if this occurs. It does get logged, but it wouldn't be obvious for a few minutes that something was wrong and to check the logs. I think outputting to devlog like we do for leaderboard errors makes sense.

Otherwise everything works well and as expected. I wasn't able to test the scheduler changes, but I can also worry about it in 11 months.

It's a warning log that will be pushed to sentry, and output to #dev-alerts, like most other problems of this type in our other bots

ChrisLovering commented 5 months ago

Just realised I never gave event leads access to run this command, added a small commit to fix this.