| Commit message (Collapse) | Author | Age | Lines |
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |\ |
|
| | |\
| | |
| | | |
Setup Sentry
|
| | |/ |
|
| | |\
| | |
| | | |
Update contributor doc
|
| | | |\
| | |/
| |/| |
|
| | | | |
|
| | | |
| | |
| | |
| | | |
Simplify internal structure & adjust var naming.
|
| | | |
| | |
| | |
| | |
| | | |
This simplifies the function and is more in-line with how the function
is being used.
|
| | | |
| | |
| | |
| | |
| | | |
To avoid confusion, the packages should no longer be referred to
as 'seasons'.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | | |
Keep it consistent with all other cogs.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Suggested by Scrags.
Co-authored-by: scragly <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
This channel no longer exists and creeps into error messages
as #deleted-channel.
Fixes: #335
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | | |
The module is full of complicated annotations, and the full `typing`
takes up annoyingly much visual space.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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]>
|
| | | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
The methods will pretend that the selected asset was uploaded
successfully. This allows extensive testing of the branding manager
without API abuse.
|
| | | |
| | |
| | |
| | | |
This should be very useful for testing. See docstring.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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]>
|
| | | |
| | |
| | |
| | |
| | | |
This is unused and no longer necessary, as all extensions load only
once: on start-up, in `__main__.py`.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | | |
This allows more flat code as raising will short-circuit,
plus we do not need to build negative response embeds manually.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | | |
Fixed a bug where the `cycle` coroutine wasn't being awaited when
called via a command.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
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!
|
| | | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|