| Commit message (Collapse) | Author | Age | Lines |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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.
|
| |\ |
|
| | |
| | |
| | | |
Co-Authored-By: Karlis S. <[email protected]>
|
| | | |
|
| | | |
|
| | | |
|
| |\ \ |
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Defining seasons in seasonal packages' __init__.py files made more
sense when extensions were strictly tied to seasons. It introduces an
annoying circular dependency where a seasonal package must be imported
in order for the __init__.py file to run and register the season, but
it also imports SeasonBase from the parent directory so that it can
inherit from it.
I have made the decision to scrap the seasonal __init__.py files, and
instead define all seasons directly under SeasonBase. The classes are
no longer scattered around, we remove the above mentioned import
problem, and everything is more transparent and easier to digest.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We no longer use the class docstrings for announcements, and they
mostly contain outdated information. Sentences still relevant are
used to populate the `description` attr (which shows in the branding
embed), the rest is scrapped.
The descriptions themselves can still be improved in the future, once
we figure out exactly in which direction we want to go with them.
The idea of providing a description for each season's branding was
originally brought up by neonsea, co-authored below.
Co-authored-by: Rasmus Moorats <[email protected]>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We'll use this to colour the branding embed, as it currently looks very
plain. Seasons can either provide their own, or just use the default
green.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
It makes more sense for it to be positioned alongside other core bot
features.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
We want to prevent listeners from performing season-specific behaviour
outside of specific months.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| |\ \ \ |
|