aboutsummaryrefslogtreecommitdiffstats
path: root/bot/seasons (follow)
Commit message (Collapse)AuthorAgeLines
* Deseasonify: rename `seasons` pkg to `exts`Gravatar kwzrd2020-03-28-9782/+0
| | | | | | | | | 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-0/+504
|
* Deseasonify: move help extension under evergreen pkgGravatar kwzrd2020-03-28-0/+549
|
* Deseasonify: move decorators module under utilsGravatar kwzrd2020-03-28-13/+13
|
* Deseasonify: move pagination module under utilsGravatar kwzrd2020-03-26-4/+3
|
* Deseasonify: move exceptions module under utilsGravatar kwzrd2020-03-26-1/+1
|
* 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: move bookmark icon under `Icons` constantsGravatar kwzrd2020-03-24-2/+2
|
* Deseasonify: re-lock seasonal listeners with new `in_month`Gravatar kwzrd2020-03-24-5/+5
|
* Deseasonify: abdicate responsibility to wait until bot is readyGravatar kwzrd2020-03-23-0/+4
| | | | | | | | | | | | | | | | 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: handle BrandingErrorGravatar kwzrd2020-03-22-0/+5
|
* Deseasonify: simplify `get_extensions` convenience functionGravatar kwzrd2020-03-21-10/+4
| | | | | | | | | | | | 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.
* Deseasonify: improve `get_seasons` convenience functionGravatar kwzrd2020-03-21-7/+8
|
* Merge master into seasonal-purgeGravatar kwzrd2020-03-21-0/+444
|\ | | | | | | | | Most importantly this adds the Python 3.8 bump, plus unrelated features merged in the meantime.
| * Merge branch 'master' into battleshipsGravatar S. Co12020-03-20-93/+826
| |\
| * | Battleships - change hard-coded strings in subcommandGravatar Suhail6inkling2020-03-20-2/+2
| | | | | | | | | Co-Authored-By: Karlis S. <[email protected]>
| * | Battleships - alter positioning of some commentsGravatar Suhail2020-03-05-5/+10
| | |
| * | Applied suggestions from code review for BattleshipsGravatar Suhail2020-03-01-18/+60
| | |
| * | Applied suggestions from code review for BattleshipsGravatar Suhail2020-02-07-199/+209
| | |
| * | Merge branch 'master' into battleshipsGravatar Suhail2020-02-06-1228/+1802
| |\ \
| * | | Post results and boards to initial channelGravatar Suhail2019-08-05-6/+34
| | | |
| * | | Battleships GameGravatar Suhail2019-08-05-0/+359
| | | |
* | | | Deseasonify: define all seasons in one placeGravatar kwzrd2020-03-21-129/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Deseasonify: turn legacy docstrings into attrsGravatar kwzrd2020-03-19-70/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
* | | | Deseasonify: add colour attr to seasonal classesGravatar kwzrd2020-03-19-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Deseasonify: improve `SeasonBase` docstring wordingGravatar kwzrd2020-03-17-2/+2
| | | |
* | | | Deseasonify: move the branding module from seasons to bot directoryGravatar kwzrd2020-03-15-315/+0
| | | | | | | | | | | | | | | | | | | | It makes more sense for it to be positioned alongside other core bot features.
* | | | Deseasonify: apply seasonal task mechanism to tasks as appropriateGravatar kwzrd2020-03-15-21/+6
| | | |
* | | | Deseasonify: season-lock listeners where appropriateGravatar kwzrd2020-03-15-1/+8
| | | | | | | | | | | | | | | | | | | | We want to prevent listeners from performing season-specific behaviour outside of specific months.
* | | | Deseasonify: improve `in_month` command checkGravatar kwzrd2020-03-15-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Deseasonify: lock branding commands to moderation rolesGravatar kwzrd2020-03-15-1/+3
| | | |
* | | | Deseasonify: use more descriptive name for `Record` namedtupleGravatar kwzrd2020-03-15-15/+15
| | | |
* | | | Deseasonify: improve logic in `set` commandGravatar kwzrd2020-03-14-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Deseasonify: implement `BrandingManager` cogGravatar kwzrd2020-03-14-0/+312
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Deseasonify: add convenience method to get season by nameGravatar kwzrd2020-03-14-2/+17
| | | |
* | | | Deseasonify: add convenience method to get current seasonGravatar kwzrd2020-03-14-2/+22
| | | |
* | | | Deseasonify: lock daily tasks to their seasons' respective monthsGravatar kwzrd2020-03-08-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Deseasonify: adjust inheriting seasons in accordance with new systemGravatar kwzrd2020-03-08-66/+26
| | | | | | | | | | | | | | | | | | | | Ensure that all inheriting seasons are now providing the right attrs as defined in `SeasonBase`.
* | | | Deseasonify: remove `Evergreen` seasonGravatar kwzrd2020-03-08-17/+0
| | | | | | | | | | | | | | | | | | | | The `SeasonBase` now serves as the fallback, off-season season for when no other season is available.
* | | | Deseasonify: implement `SeasonBase` for new seasonal systemGravatar kwzrd2020-03-08-12/+16
| | | | | | | | | | | | | | | | See class docstring for implementation details.
* | | | Deseasonify: allow `get_extensions` to find cogs in `seasons`Gravatar kwzrd2020-03-08-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Deseasonify: remove redundant importGravatar kwzrd2020-03-07-2/+0
| | | |
* | | | Deseasonify: remove empty season moduleGravatar kwzrd2020-03-07-0/+0
| | | | | | | | | | | | | | | | The file snuck back in during merge conflict resolve.
* | | | Deseasonify: create daily tasks inside cog init; wait until readyGravatar kwzrd2020-03-07-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Deseasonify: remove reference to non-existent task, redundant attrGravatar kwzrd2020-03-07-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge branch 'master' into seasonal-purgeGravatar kwzrd2020-03-07-91/+485
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | Update the feature branch. This resolves a conflict in the season.py module, which has been since been deprecated and removed.
| * | | Add more pre-commit hooksGravatar MarkKoz2020-03-04-67/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | Update dependenciesGravatar MarkKoz2020-03-04-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | Merge branch 'master' into games-commandGravatar Shirayuki Nekomata2020-03-05-15/+25
| |\ \ \