aboutsummaryrefslogtreecommitdiffstats
path: root/bot/bot.py (unfollow)
Commit message (Collapse)AuthorLines
2020-03-28Deseasonify: log in `add_cog` rather than in each `setup`Gravatar kwzrd-55/+9
The previous system required each extension's `setup` func to log that the cog was loaded. This leads to inconsistent messages all trying to convey the same thing, variable logger names in the output file are difficult to read, and several extensions were not logging at all. By logging directly in the `add_cog` method, we reduce code repetition, ensure consistent format, and remove the responsibility to remember that a log should be made.
2020-03-28Deseasonify: make `get_extensions` an iteratorGravatar kwzrd-12/+15
Simplify internal structure & adjust var naming.
2020-03-28Deseasonify: make `get_package_names` an iteratorGravatar kwzrd-10/+6
This simplifies the function and is more in-line with how the function is being used.
2020-03-28Deseasonify: rename utility functionGravatar kwzrd-5/+5
To avoid confusion, the packages should no longer be referred to as 'seasons'.
2020-03-28Deseasonify: separate seasonal definitions into new moduleGravatar kwzrd-168/+160
Since the original `seasons` package is now called just `exts`, it makes sense to migrate all season-specific definitions out into a separate module. This module now contains everything relating to 'new' seasons, i.e. just branding tooling.
2020-03-28Deseasonify: rename `seasons` pkg to `exts`Gravatar kwzrd-9/+9
It is believed that this is now a more logical name for the package, as extensions no longer bind to seasons. Internally, packages are still grouped into seasonal sub-packages. There are quite a few, and it makes sense to group them by a common theme that inspired their functionality.
2020-03-28Deseasonify: info log on help cog loadGravatar kwzrd-0/+5
Keep it consistent with all other cogs.
2020-03-28Deseasonify: move branding extension under evergreen pkgGravatar kwzrd-2/+0
2020-03-28Deseasonify: move help extension under evergreen pkgGravatar kwzrd-1/+0
2020-03-28Deseasonify: move decorators module under utilsGravatar kwzrd-16/+16
2020-03-26Deseasonify: move pagination module under utilsGravatar kwzrd-6/+5
2020-03-26Deseasonify: move exceptions module under utilsGravatar kwzrd-2/+2
2020-03-26Deseasonify: ignore dirs in server icons dirGravatar kwzrd-3/+8
As per Scrags' & Lemon's request, icon discovery will ignore directories in the branding repo's `server_icons` directory, so that unused files can be placed there without interfering with the bot's discovery mechanism. Co-authored-by: scragly <[email protected]> Co-authored-by: Leon Sandøy <[email protected]>
2020-03-26Deseasonify: use help-friendly docstring summariesGravatar kwzrd-8/+29
Clean up the summary docstring lines such that they read better in the automatically generated help embed. Extend some of the docs so that they provide information that may be useful to users unaware of the internal implementation.
2020-03-26Deseasonify: show help on group invokeGravatar kwzrd-13/+14
Previously, when a group was called without a specific subcommand, the status / info command was invoked automatically. This was inconsistent with how other cogs behave, and makes it difficult to discover the full API. The logic from the `daemon` group is split off into a separate cmd to allow this behaviour.
2020-03-26Deseasonify: season-lock commands where appropriateGravatar kwzrd-12/+25
I left as many available as possible. Some of the commands also handle being outside of their original season, e.g. by showing the amount of time until Hacktoberfest begins, if not currently active. These were left available as well. If a group is to be locked, the `invoke_without_command` param must be False (default), otherwise the group's callback will be circumvented if a valid subcommand is invoked. I adjusted these where necessary, except for the `HacktoberStats` cog, whose cmd group takes an arg, which would require a more involved adjustment - I decided to leave it as is, and instead manually lock both subcommands.
2020-03-26Deseasonify: extend `in_month` docGravatar kwzrd-0/+5
2020-03-25Setup SentryGravatar Joseph Banks-29/+85
2020-03-25Deseasonify: add 'task' alias to daemon groupGravatar kwzrd-1/+1
Suggested by Scrags. Co-authored-by: scragly <[email protected]>
2020-03-24Deseasonify: remove outdated `devtest` channel constantGravatar kwzrd-2/+0
This channel no longer exists and creeps into error messages as #deleted-channel. Fixes: #335
2020-03-24Deseasonify: clean up `constants` moduleGravatar kwzrd-27/+45
Order config classes and constants alphabetically (within groups). Add missing classes to `__all__`, and style it as a vertical list. This will make it easier to maintain, and allows it to serve as a summary of the module's contents.
2020-03-24Deseasonify: move bookmark icon under `Icons` constantsGravatar kwzrd-8/+6
2020-03-24Deseasonify: use 't-dot' notation for type annotationsGravatar kwzrd-19/+19
The module is full of complicated annotations, and the full `typing` takes up annoyingly much visual space.
2020-03-24Deseasonify: re-lock seasonal listeners with new `in_month`Gravatar kwzrd-5/+5
2020-03-24Deseasonify: add generic `in_month` decoratorGravatar kwzrd-1/+34
See docstring for further details. This serves as a convenience wrapper around `in_month_command` and `in_month_listener` to allow a consistent API. Proposed by lemon. Co-authored-by: Leon Sandøy <[email protected]>
2020-03-24Deseasonify: rename `in_month` decoratorGravatar kwzrd-1/+1
Indicate that the decorator shall only be applied to commands. The `in_month` name will be used for a universal decorator that can season-lock both listeners and commands.
2020-03-24Deseasonify: mock expensive API calls in debug modeGravatar kwzrd-1/+17
The methods will pretend that the selected asset was uploaded successfully. This allows extensive testing of the branding manager without API abuse.
2020-03-23Deseasonify: add `mock_in_debug` decoratorGravatar kwzrd-1/+21
This should be very useful for testing. See docstring.
2020-03-23Deseasonify: abdicate responsibility to wait until bot is readyGravatar kwzrd-7/+7
The wrapper will no longer wait for the bot to be ready before it calls the wrapped function for the first time. If the function requires the bot's cache to be ready, it is responsible for awaiting the method itself. This removes the need to acquire a reference to the bot instance inside the decorator, which seems to be difficult to do cleanly. As Mark adds, this may in fact be safer as the bot may temporarily disconnect while the task is active, and awaiting the bot's ready status every time will prevent issues in such a situation. Co-authored-by: MarkKoz <[email protected]>
2020-03-23Deseasonify: remove `load_extensions` methodGravatar kwzrd-19/+1
This is unused and no longer necessary, as all extensions load only once: on start-up, in `__main__.py`.
2020-03-23Deseasonify: extend BrandingManager documentationGravatar kwzrd-11/+50
2020-03-23Deseasonify: use BrandingError for negative responsesGravatar kwzrd-22/+18
This allows more flat code as raising will short-circuit, plus we do not need to build negative response embeds manually.
2020-03-22Deseasonify: handle BrandingErrorGravatar kwzrd-0/+5