aboutsummaryrefslogtreecommitdiffstats
path: root/bot/bot.py (unfollow)
Commit message (Collapse)AuthorLines
2020-11-30Set correct channel ID as default for AoC channelGravatar Sebastiaan Zeeff-1/+1
2020-11-30Remove now redundant advent_of_code_staff constantGravatar Sebastiaan Zeeff-2/+1
We're no longer going to use a two-channel setup for this event, as we don't want to split the event community into two, staff and non-staff.
2020-11-30Remove redundant _error_embed_helper functionGravatar Sebastiaan Zeeff-7/+3
This helper function was only being used in one spot and did not factor out any logic. I've removed the helper function to just create the embed where it's needed.
2020-11-30Rewrite Advent of Code leaderboard logicGravatar Sebastiaan Zeeff-0/+680
I've rewritten the Advent of Code leaderboard logic. Unfortunately, nearly all of the changes made are interrelated, meaning that they've ended up in the same commit. To add a bit of structure to the extension, I've chosen for a subpackage structure instead of a single file structure. The biggest changes: - Whether or not you get a join code for the staff leaderboard will now be determined by looking for the Helpers-role. - The Python Discord Leaderboard now includes all boards, including the staff leaderboard. This is one event. - Redis is now used to set a cache expiry period. This means that our code does not have to check for cache staleness; Redis will do that for us. - The period "fetching" task has been removed. We now fetch solely when the data is needed to prevent putting unnecessary stress on the Advent of Code website. - The option to display the Global Leaderboard within Discord has been removed. Rather, we now link to the website. This simplified the code for now, although we could add it back later. - An additional command, `.aoc refresh`, has been added to allow Admins and the Events Lead to force the cache to be invalidated. This should be done sparingly to not overburden the AoC website. - I've also made sure that the daily notification task actually pings the notification role by setting the `allowed_mentions` kwarg.
2020-11-30Remove adventofcode.py in favour of subpackageGravatar Sebastiaan Zeeff-983/+0
As the Advent of Code file was getting massive, I've removed the old single-file based extension as I'm going to replace it with a partially rewritten subpackage-based extension.
2020-11-30Add constants parsing for multiple leaderboardsGravatar Sebastiaan Zeeff-9/+38
I've added a unified approach to setting data for multiple leaderboards using environmental variables. Instead of setting separate variables for the three pieces of data we have, hoping that the position of each board matches up in the three fields, I now set one environmental variable, AOC_LEADERBOARDS, that holds delimited data. The data is in the format: board_id1,session1,join_code1::board_id2,session2,join_code2[::...] The staff leaderboards should be included as usual in this environmental variable. Another environment variable, AOC_STAFF_LEADERBOARD_ID, can be used to designate which leaderboard should be used as the staff board. I've also made some other constants configurable in this commit and added the role ID of the Events Lead role to allow the Events Lead to force a reload of the leaderboard cache.
2020-11-27Fix adventofcode extension (and constants) grammarGravatar ks129-12/+12
Co-authored-by: Joe Banks <[email protected]>
2020-11-27Use default 0 for score and reverse leaderboard membersGravatar ks129-1/+3
2020-11-27Handle leaderboard cache create/update failGravatar ks129-12/+52
2020-11-27Remove unnecessary check for members in leaderboard updater taskGravatar ks129-3/+1
2020-11-27Add comment about choosing leaderboard for userGravatar ks129-0/+1
2020-11-26Store AoC leaderboard IDs instead join codes for users mappingGravatar ks129-5/+10
2020-11-26Implement staff and public leaderboardsGravatar ks129-58/+197
2020-11-25Implement different invitation codes for staff and public leaderboardsGravatar ks129-11/+66
2020-11-24Add comments about AoC env config order and change cookies wayGravatar ks129-1/+4
2020-11-24Add staff AoC channel to whitelistGravatar ks129-1/+1
2020-11-24Update constants to match with new format of AoC that will run in 2020Gravatar ks129-3/+6
2020-11-24Update CODEOWNERSGravatar Joe Banks-1/+2
2020-11-24Update CODEOWNERSGravatar Joe Banks-1/+1
2020-11-23Fix parameter specification in Build workflowGravatar Sebastiaan Zeeff-4/+6
2020-11-23Use deployment.yaml defined in the kubernetes repoGravatar Sebastiaan Zeeff-24/+13
Our dear knight, Sir Lancebot, will now get their deployment information from the private python-discord/kubernetes repository. The workflow will use GitHub Personal Access Token to access this private repository. To not mix up files, the repositories are checked out side-by-side in subdirectories of the workflow directory.
2020-11-23Narrow down repository events that trigger a buildGravatar Sebastiaan Zeeff-1/+1
I've narrowed down repository events that trigger a Build to the "push" event specifically. This means that we never build for a "pull request" trigger, even if the source branch is called "master".
2020-11-22fix typos in docstringGravatar fisher60-1/+1
2020-11-22make init variables more readable, fix docstring, remove redundant listGravatar fisher60-6/+6
2020-11-21move constants to init, change [-1] to .endswith()Gravatar fisher60-9/+9
2020-11-21Add a banner and fix the README a bit.Gravatar Leon Sandøy-2/+4