| Commit message (Collapse) | Author | Age | Lines |
| | |
|
| |
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
This allows manually starting and stopping the daemon if necessary.
Enables introspection in the sense that we can check whether the daemon
is currently running, and for when is the next refresh scheduled.
In the case that the daemon dies due to an unhandled exception, the
start command is able to revive it. The daemon currently does not alert
us when it dies.
|
| |
|
|
|
| |
This will allow more introspection in the sense of displaying the
remaining time until midnight in a human-readable format.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
During development it may be useful to not have the branding daemon
start automatically - this env var will make that possible.
|
| |
|
|
|
|
| |
Since we'll be adding more env vars to control the branding manager,
let's add a new config category. As a result, the cycle frequency
constant name can be made shorter.
|
| |
|
|
| |
Unused and no longer relevant.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This is a little tricky, as we only want to walk the modules in each
season's package. The pkgutil module provides a convenient function
called `walk_packages` which can walk recursively, but this isn't
desirable as not all modules are cogs - for example, the modules nested
under `evergreen.snakes` are only helpers, and the `setup` function is
instead present in the package's `__init__.py`.
As we no longer have modules directly in the seasons package, we can
remove the `ispkg` check.
|
| | |
|
| |\
| |
| |
| |
| | |
Most importantly this adds the Python 3.8 bump, plus unrelated features
merged in the meantime.
|
| | |\
| | |
| | | |
Add `data` persistence directory to .gitignore
|
| | |/ |
|
| | |\
| | |
| | | |
Battleships Game
|
| | | |\
| | |/
| |/| |
|
| | |\ \
| | | |
| | | | |
Bump Python version to 3.8
|
| | | |\ \
| | |/ /
| |/| | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | |
| | | | |
Co-Authored-By: Karlis S. <[email protected]>
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | |\ |
|
| | | | | | |
|
| | | | | | |
|