| Commit message (Collapse) | Author | Age | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
The previous implementation would simply ignore assets not present in
the current season's directory.
On the condition that at least one asset is missing, and the current
season is not the evergreen, we also poll the evergreen directory,
and use it as fallback.
This behaviour is shielded such that we only make the extra API call if
there is a missing asset, i.e. if there is something to be gained.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Since the banner and avatar assets will always have the same filename,
we need their full paths to differentiate between assets of different
seasons. Rather than introducing more complexity to the `pretty_files`
function and deconstructing the download urls, we can just store the
path as provided by the API.
We also now print the `path` instead of showing bools in the status
embed, as just the fact that there is some banner is not enough
information - we want to know which season's banner has been picked
up during refresh.
|
| |
|
|
|
| |
We do not have any multi-word seasons at the moment, but there is no
reason to restrict the command to just one word.
|
| | |
|
| |
|
|
|
| |
Asyncio's sleep will accept both, and we default to an int, so might
as well not break our own promise.
|
| |
|
|
|
|
|
|
|
| |
Importing the bot instance will allow us to safely access
the `wait_until_ready` method without having to make fragile
assumptions about the arguments passed to the decorated method.
Although still not perfect, this feels a lot cleaner and safer than
the previous approach.
|
| |\
| |
| |
| |
| |
| |
| | |
This merges the newly added help cog.
Resolve slight conflict in the __main__ module caused by the the master
branch still assuming the presence of the legacy season manager cog.
|
| | |\
| | |
| | | |
Added Python bot help command to SeasonalBot
|
| | | |\
| | |/
| |/| |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | | |
reverted icon removal in `.help` command.
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | | |
SeasonalBot, marked them down with comments and fixed docstrings formatting for linting.
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | | |
It makes more sense for it to be positioned alongside other core bot
features.
|
| | | | |
|
| | | |
| | |
| | |
| | | |
See docstring for implementation details.
|
| | | |
| | |
| | |
| | |
| | | |
We want to prevent listeners from performing season-specific behaviour
outside of specific months.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
A guarded listener will abort if the triggering event happens outside
of `allowed_months`. This provides a convenient way of season-locking
listeners without having to write guards directly within their bodies.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Raise a custom exception if the command fails. This is then handled
in the error handler, and the user will be informed of which months
allow the invoked command.
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Prevent re-applying branding if the user requests an already active
season. This saves us an expensive operation.
Only trigger typing if season switch was successful and `apply` will
be called, as otherwise the bot will respond immediately.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Provides a background daemon capable of autonomously managing the
guild's and bot's branding across seasons. Alternatively, the cog
can be manually controlled via the `branding` command group.
See docstrings for detailed implementation details.
Actual calls to Discord API are commented out and replaced with logs,
to prevent API abuse during development.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Applies to daily egg facts and pride facts of the day. Currently, we do
not have any sophisticated mechanism in place. However, we can simply
configure `active_months` for the cog, and then have the task perform
a membership check in each cycle.
|
| | | |
| | |
| | |
| | |
| | | |
Ensure that all inheriting seasons are now providing the right attrs
as defined in `SeasonBase`.
|
| | | |
| | |
| | |
| | |
| | | |
The `SeasonBase` now serves as the fallback, off-season season for when
no other season is available.
|
| | | |
| | |
| | |
| | | |
See class docstring for implementation details.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Add a conditional check to handle cases where `package` is, in fact,
just a plain module, and should be loaded directly rather than being
searched for modules.
The naming here could be improved: `package` does not necessarily have
to be a package.
|
| | | | |
|
| | | |
| | |
| | |
| | | |
The file snuck back in during merge conflict resolve.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously, the cog was being instantiated once: once to launch the
task, and once to be registered under `bot`. Now, the cog is only
created once, and the task is built inside the cog's init.
Since cogs are now loaded before the bot connects, the tasks need to
wait before the bot's cache is ready, to ensure that the channel is
found.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The `_fact_publisher_task` task was removed many commits ago, yet the
listener still attempts to launch it.
There is no need to set the channel instance attr, as it isn't used
anywhere.
This renders the listener useless, and it can be removed.
|
| |\| |
| | |
| | |
| | |
| | | |
Update the feature branch. This resolves a conflict in the season.py
module, which has been since been deprecated and removed.
|
| | |\ \
| | | |
| | | | |
Name the use Python version task
|
| | |/ /
| | |
| | |
| | | |
The name is needed to be able to retrieve its output variable.
|
| | |\ \
| | | |
| | | | |
Add pep8-naming and more pre-commit hooks
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Pre-commit creates its own environment in which it installs hooks. To
speed up runs, the pipeline will cache this for use with future jobs.
The cache will update if .pre-commit-config.yaml changes.
The flake8 pre-commit hook invokes flake8 via `pipenv run flake8`. It's
normally useful to use pipenv here cause it ensures flake8 is invoked
within the context of the venv. However, in CI, there is no venv -
dependencies are installed directly to the system site-packages.
`pipenv run` does not work in such case because it tries to create a new
venv if one doesn't exist (it doesn't consider the system interpreter to
be a venv).
This workaround (okay, it's a hack) creates an executable shell script
which replaces the original pipenv binary. The shell script simply
ignores the first argument (i.e. ignores `run` in `pipenv run`) and
executes the rest of the arguments as a command. It essentially makes
`pipenv run flake8` equivalent to just having ran `flake8`. When
pre-commit executes pipenv, the aforementioned script is what will run.
* Re-format indentation of azure-pipelines.yml
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Hooks added:
* check-merge-conflict - checks for files with merge conflict strings
* check-toml - attempts to load all toml files to verify syntax
* check-yaml - attempts to load all yaml files to verify syntax
* end-of-file-fixer - ensures files end in a newline and only a newline
* mixed-line-ending - replaces mixed line endings with LF
* trailing-whitespace - trims trailing whitespace
* python-check-blanket-noqa - enforces that noqa annotations always
occur with specific codes
Changes made to comply with new hooks:
* Remove trailing whitespaces
* Convert some CRLF files to LF
* Remove noqa and add missing type annotations
* Add missing newlines at end of files
See: python-discord/organisation#138
|
| | |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The pipfile will need to be re-locked to add a dependency so may as well
re-pin some dependencies to reflect the more recent versions that will
be used. discord.py was pinned to a patch version instead of a minor
version to be on the safe side.
Notable updates:
* discord.py -> 1.3.2
* flake8-annotation -> 2.0
* pre-commit -> 2.1
|
| | |\ \
| | | |
| | | | |
Added .games command
|
| | | |\ \
| | |/ /
| |/| | |
|
| | |\ \ \
| | | | |
| | | | | |
Strip references to seasonalbot chat
|