aboutsummaryrefslogtreecommitdiffstats
path: root/bot (follow)
Commit message (Collapse)AuthorAgeLines
* Deseasonify: fallback on evergreen on incomplete brandingGravatar kwzrd2020-03-18-3/+23
| | | | | | | | | | | | 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.
* Deseasonify: keep track of `path` on github filesGravatar kwzrd2020-03-18-11/+7
| | | | | | | | | | | | | 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.
* Deseasonify: allow `set` to take multi-word argsGravatar kwzrd2020-03-17-1/+1
| | | | | We do not have any multi-word seasons at the moment, but there is no reason to restrict the command to just one word.
* Deseasonify: improve `SeasonBase` docstring wordingGravatar kwzrd2020-03-17-2/+2
|
* Deseasonify: relax type annotationGravatar kwzrd2020-03-15-1/+1
| | | | | Asyncio's sleep will accept both, and we default to an int, so might as well not break our own promise.
* Deseasonify: remove fragile attr dependency in `seasonal_task`Gravatar kwzrd2020-03-15-6/+5
| | | | | | | | | 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.
* Merge branch 'master' into seasonal-purgeGravatar kwzrd2020-03-15-1/+557
|\ | | | | | | | | | | | | 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.
| * Merge branch 'master' into helpGravatar S. Co12020-03-13-119/+523
| |\
| * | (Help): Comments CleanupGravatar ks1232020-03-13-13/+0
| | |
| * | (Help): Removed unnecessary comments about changesGravatar ks1232020-03-10-8/+0
| | |
| * | (Help): Added `Icons` class to constant, added `questionmark` to there, ↵Gravatar ks1232020-03-10-2/+5
| | | | | | | | | | | | reverted icon removal in `.help` command.
| * | (Help): Added cog loading to __main__.pyGravatar ks1232020-03-07-0/+1
| | |
| * | (Help): Added unloading block in cogs loadingGravatar ks1232020-03-07-1/+1
| | |
| * | (Help): Made modifications to original code to make this working in ↵Gravatar ks1232020-03-07-10/+26
| | | | | | | | | | | | SeasonalBot, marked them down with comments and fixed docstrings formatting for linting.
| * | (Help): Added information comment to top of fileGravatar ks1232020-03-07-0/+1
| | |
| * | Copy-pasted help command content from Python botGravatar ks1232020-03-07-0/+554
| | |
* | | Deseasonify: move the branding module from seasons to bot directoryGravatar kwzrd2020-03-15-0/+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: add convenience decorator for seasonal tasksGravatar kwzrd2020-03-15-0/+39
| | | | | | | | | | | | See docstring for implementation details.
* | | 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: add listener decorator for season lockingGravatar kwzrd2020-03-15-0/+22
| | | | | | | | | | | | | | | | | | 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.
* | | Deseasonify: improve `in_month` command checkGravatar kwzrd2020-03-15-4/+15
| | | | | | | | | | | | | | | | | | 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: improve documentation for `icon_cycle_frequency`Gravatar kwzrd2020-03-14-1/+1
| | |
* | | Deseasonify: add `set_banner` method to SeasonalBotGravatar kwzrd2020-03-14-0/+18
| | |
* | | 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-117/+510
|\ \ \ | | |/ | |/| | | | | | | 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-91/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-17/+27
| |\ \
| | * | Strip references to seasonalbot chatGravatar S. Co12020-03-01-14/+12
| | | | | | | | | | | | | | | | Redirect any output to seasonalbot commands, where relevant
| | * | Update devlog channel constantGravatar S. Co12020-02-25-1/+1
| | | | | | | | | | | | The log channels have become one
| | * | Cycle icons within season in configured interval onlyGravatar kwzrd2020-02-23-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `load_seasons` task now has an internal state, which increments for every day. Before cycling the icon within the same season, first check whether we've waited the configured amount of days since the last cycle. Entering a new season, or changing the icon, resets the state to 0. This allows us to slow down the rate at which we cycle icons, addressing a bug where the icon wasn't loading for some users.
| | * | Add icon cycle frequency constantGravatar kwzrd2020-02-23-0/+1
| | | |
| | * | Calculate seconds as n_hours * seconds_in_hourGravatar kwzrd2020-02-23-1/+1
| | |/ | | | | | | | | | This is a lot more readable than just 86400.
| * | (Games Cog): Added space between game search result + removed cutoff in ↵Gravatar Karlis S2020-03-04-2/+2
| | | | | | | | | | | | get_close_matches.
| * | (Games Cog): Moved `string.Template` to `str.format()`, applied changes ↵Gravatar ks1232020-03-04-51/+37
| | | | | | | | | | | | everywhere.