aboutsummaryrefslogtreecommitdiffstats
path: root/bot/bot.py (unfollow)
Commit message (Collapse)AuthorLines
2020-12-11Change Default AoC Commands ChannelGravatar janine9vn-1/+1
Changes the default value of the advent_of_code_commands constant to be the same channel ID as sir-lancebot-commands. If no AoC commands channel is set in the .env file, it'll re-direct people to sir-lancebot-commands instead.
2020-12-11Remove extra pleaseGravatar janine9vn-1/+1
Please -= 1
2020-12-11Remove re-raising the errorGravatar janine9vn-2/+0
Per Mark's comment, re-raising the error isn't necessary.
2020-12-11Change custom error handler to match new styleGravatar janine9vn-1/+1
I'm a bit ahead of the game and changing the error handler to match the new style that Iceman will PR shortly.
2020-12-11Add cog-level error handler for Incorrect ChannelGravatar janine9vn-6/+18
If any of the "spammier" commands (stats, leaderboard) are used within the primary advent of code channel, rather than a non-specific embed we instead reply with the channel they should be using. This also adds a "AOC_WHITELIST_PLUS" constant that makes it easier to adjust what channels the non-spammier aoc commands can be used in.
2020-12-11Disallow .aoc commands in primary aoc channelGravatar janine9vn-5/+6
Commands like `.aoc leaderboard` and `.aoc stats` proved to be spammy in the main advent of code channel. An aoc_commands channel has been added for aoc commands and this update prohibits aoc commands from being used in the primary aoc channel and adds the comands channel to the whitelist. This also specifically allows the less spammier commands: join, subscribe, unsubscribe, and countdown in the primary channel to foster discussion though.
2020-12-11Make sure PR artifacts are always uploadedGravatar Sebastiaan Zeeff-1/+1
We need to upload PR artifacts regardless of our lint job failing. As GitHub Actions uses an implicit "success" status function if you don't specify one of your own, we need to include the "always" function in our condition.
2020-12-11Check if error.original is an instance of OSError.Gravatar Rohan-4/+3
Also, remove error handler for get_command and video_command.
2020-12-10Skip status embed for skipped Build workflowGravatar Sebastiaan Zeeff-2/+3
With the new `workflow_run` setup, we need to make sure that we don't try to send an embed for a skipped workflow. This would be noisy and does not add a lot of useful information.
2020-12-10Use Build Artifact to communicate PR informationGravatar Sebastiaan Zeeff-18/+41
A workflow run with a `workflow_run` payload does not contain the necessary information to build a PR embed. As the old method of using the API to fetch the relevant information turned out to be fragile (read note 1 below) and the original Lint workflow already contains the `pull_request` payload, we now store it as a build artifact. The embed workflow then fetches the artifact and parses it to get the relevant information out of it. --- Note 1: Unfortunately, filtering Pull Requests using the "head" parameter of the ``/repos/{owner}/{repo}/pulls` endpoint does not work if the PR belongs to a fork with a different name than the base repository: the API request will just return an empty array. I've contacted GH to ask if this was intended or if it's a glitch, but, for now, it's not a route that's easily available.
2020-12-09Use workflow_run to send status embed to DiscordGravatar Sebastiaan Zeeff-63/+71
I've changed the way we send status embeds to make it work for PRs made from forks without potentially exposing secrets. Instead of using the initial workflows to send the embed, I've created a `workflow_run` workflow that always runs in the context of the base repository. And added benefit is that we don't have to add the status embed step to two separate workflows.
2020-12-07Modify snakes_cog error handler.Gravatar Rohan-16/+6
local error handler no longer checks for BadArgument error and the attribute handled will be set to True on the error if an OSError occurs.