aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
* Deseasonify: add cmd showing all available seasonsGravatar kwzrd2020-03-28-1/+24
|
* Deseasonify: add helper to give all available seasonsGravatar kwzrd2020-03-28-1/+6
|
* Deseasonify: log in `add_cog` rather than in each `setup`Gravatar kwzrd2020-03-28-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.
* Merge master: sentry sdk, updated contributing docsGravatar kwzrd2020-03-28-54/+123
|\
| * Merge pull request #383 from python-discord/setup-sentryGravatar scragly2020-03-26-29/+85
| |\ | | | | | | Setup Sentry
| | * Setup SentryGravatar Joseph Banks2020-03-25-29/+85
| |/
| * Merge pull request #378 from python-discord/update-contribGravatar kwzrd2020-03-23-25/+38
| |\ | | | | | | Update contributor doc
| | * Merge branch 'master' into update-contribGravatar kwzrd2020-03-23-0/+1
| | |\ | | |/ | |/|
| | * Update contributor docGravatar S. Co12020-03-20-25/+38
| | |
* | | Deseasonify: make `get_extensions` an iteratorGravatar kwzrd2020-03-28-12/+15
| | | | | | | | | | | | Simplify internal structure & adjust var naming.
* | | Deseasonify: make `get_package_names` an iteratorGravatar kwzrd2020-03-28-10/+6
| | | | | | | | | | | | | | | This simplifies the function and is more in-line with how the function is being used.
* | | Deseasonify: rename utility functionGravatar kwzrd2020-03-28-5/+5
| | | | | | | | | | | | | | | To avoid confusion, the packages should no longer be referred to as 'seasons'.
* | | Deseasonify: separate seasonal definitions into new moduleGravatar kwzrd2020-03-28-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.
* | | Deseasonify: rename `seasons` pkg to `exts`Gravatar kwzrd2020-03-28-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.
* | | Deseasonify: info log on help cog loadGravatar kwzrd2020-03-28-0/+5
| | | | | | | | | | | | Keep it consistent with all other cogs.
* | | Deseasonify: move branding extension under evergreen pkgGravatar kwzrd2020-03-28-2/+0
| | |
* | | Deseasonify: move help extension under evergreen pkgGravatar kwzrd2020-03-28-1/+0
| | |
* | | Deseasonify: move decorators module under utilsGravatar kwzrd2020-03-28-16/+16
| | |
* | | Deseasonify: move pagination module under utilsGravatar kwzrd2020-03-26-6/+5
| | |
* | | Deseasonify: move exceptions module under utilsGravatar kwzrd2020-03-26-2/+2
| | |
* | | Deseasonify: ignore dirs in server icons dirGravatar kwzrd2020-03-26-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]>
* | | Deseasonify: use help-friendly docstring summariesGravatar kwzrd2020-03-26-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.
* | | Deseasonify: show help on group invokeGravatar kwzrd2020-03-26-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.
* | | Deseasonify: season-lock commands where appropriateGravatar kwzrd2020-03-26-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.
* | | Deseasonify: extend `in_month` docGravatar kwzrd2020-03-26-0/+5
| | |
* | | Deseasonify: add 'task' alias to daemon groupGravatar kwzrd2020-03-25-1/+1
| | | | | | | | | | | | | | | | | | Suggested by Scrags. Co-authored-by: scragly <[email protected]>
* | | Deseasonify: remove outdated `devtest` channel constantGravatar kwzrd2020-03-24-2/+0
| | | | | | | | | | | | | | | | | | | | | This channel no longer exists and creeps into error messages as #deleted-channel. Fixes: #335
* | | Deseasonify: clean up `constants` moduleGravatar kwzrd2020-03-24-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.
* | | Deseasonify: move bookmark icon under `Icons` constantsGravatar kwzrd2020-03-24-8/+6
| | |
* | | Deseasonify: use 't-dot' notation for type annotationsGravatar kwzrd2020-03-24-19/+19
| | | | | | | | | | | | | | | The module is full of complicated annotations, and the full `typing` takes up annoyingly much visual space.
* | | Deseasonify: re-lock seasonal listeners with new `in_month`Gravatar kwzrd2020-03-24-5/+5
| | |
* | | Deseasonify: add generic `in_month` decoratorGravatar kwzrd2020-03-24-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]>
* | | Deseasonify: rename `in_month` decoratorGravatar kwzrd2020-03-24-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.
* | | Deseasonify: mock expensive API calls in debug modeGravatar kwzrd2020-03-24-1/+17
| | | | | | | | | | | | | | | | | | The methods will pretend that the selected asset was uploaded successfully. This allows extensive testing of the branding manager without API abuse.
* | | Deseasonify: add `mock_in_debug` decoratorGravatar kwzrd2020-03-23-1/+21
| | | | | | | | | | | | This should be very useful for testing. See docstring.
* | | Deseasonify: abdicate responsibility to wait until bot is readyGravatar kwzrd2020-03-23-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]>
* | | Deseasonify: remove `load_extensions` methodGravatar kwzrd2020-03-23-19/+1
| | | | | | | | | | | | | | | This is unused and no longer necessary, as all extensions load only once: on start-up, in `__main__.py`.
* | | Deseasonify: extend BrandingManager documentationGravatar kwzrd2020-03-23-11/+50
| | |
* | | Deseasonify: use BrandingError for negative responsesGravatar kwzrd2020-03-23-22/+18
| | | | | | | | | | | | | | | This allows more flat code as raising will short-circuit, plus we do not need to build negative response embeds manually.
* | | Deseasonify: handle BrandingErrorGravatar kwzrd2020-03-22-0/+5
| | |
* | | Deseasonify: add exceptions moduleGravatar kwzrd2020-03-22-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When loading extensions, d.py circumvents the import cache by force-reloading the target module. As a consequence, exception class declaration get re-executed, which may cause the error handler to not recognize the exception via its `isinstance` checks - the raised exception may not be an instance of the class that the error handler originally imported. For this reason, it is safer to declare the exceptions on the side, in a module that will not be reloaded by d.py.
* | | Deseasonify: short-circuit on non-200 response statusGravatar kwzrd2020-03-22-1/+9
| | | | | | | | | | | | | | | | | | If Github API responds with a non-200 status, we simply return an empty dict. This is a safe value - the `refresh` function will handle this as if the directory was empty.
* | | Deseasonify: improve response messagesGravatar kwzrd2020-03-22-3/+16
| | | | | | | | | | | | | | | All responses now come in the form of an embed. When we fail to apply assets, the list of failed assets is shown to the user.
* | | Deseasonify: load bool env var properlyGravatar kwzrd2020-03-22-1/+1
| | | | | | | | | | | | | | | | | | | | | Fixes a bug where the `autostart` boolean constant wasn't being loaded properly and would always be set to True, as `bool("False") is True`. The constant now defaults to False.
* | | Deseasonify: await coroutineGravatar kwzrd2020-03-22-1/+1
| | | | | | | | | | | | | | | Fixed a bug where the `cycle` coroutine wasn't being awaited when called via a command.
* | | Deseasonify: return failed assetsGravatar kwzrd2020-03-22-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | As the `apply` method attempts to apply all 4 types of assets, it is useful to know which (if any) have failed. As all the methods that we delegate to already return a bool denoting whether the operation has succeeded, we can simply collect this information and return it to the caller.
* | | Deseasonify: uncomment API callsGravatar kwzrd2020-03-22-10/+5
| | | | | | | | | | | | | | | | | | | | | Previously, all actual calls to the API were commented and replaced by logging so that the API doesn't get spammed during development. This is no longer necessary - we can begin using the cog!
* | | Deseasonify: propagate success value of `set_icon`Gravatar kwzrd2020-03-22-3/+8
| | | | | | | | | | | | | | | | | | The `set_icon` will return False if the application fails. Sine the `cycle` function wraps it, it should allow for the value to propagate out.
* | | Deseasonify: guard bot nickname setterGravatar kwzrd2020-03-22-2/+3
| | | | | | | | | | | | | | | | | | | | | Previously we'd always set the nickname, as the BaseSeason class provides a default. However, it feels cleaner to also guard this, in case a specific season decides to override the attr to something falsey.
* | | Deseasonify: do not automatically `apply` after `set`Gravatar kwzrd2020-03-22-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous design was such that calling `set` with a new season will automatically apply the branding. This meant 'previewing' a season would require a separate command. Since `apply` is an expensive operation with consequences, it appears logical to require that the user invokes it separately & explicitly. See docstring for further details.