aboutsummaryrefslogtreecommitdiffstats
path: root/bot/bot.py (unfollow)
Commit message (Collapse)AuthorLines
2020-03-08Deseasonify: remove `Evergreen` seasonGravatar kwzrd-17/+0
The `SeasonBase` now serves as the fallback, off-season season for when no other season is available.
2020-03-08Deseasonify: implement `SeasonBase` for new seasonal systemGravatar kwzrd-12/+16
See class docstring for implementation details.
2020-03-08Deseasonify: allow `get_extensions` to find cogs in `seasons`Gravatar kwzrd-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.
2020-03-07Deseasonify: remove redundant importGravatar kwzrd-2/+0
2020-03-07Deseasonify: remove empty season moduleGravatar kwzrd-0/+0
The file snuck back in during merge conflict resolve.
2020-03-07Deseasonify: create daily tasks inside cog init; wait until readyGravatar kwzrd-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.
2020-03-07Deseasonify: remove reference to non-existent task, redundant attrGravatar kwzrd-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.
2020-03-07Deseasonify: load all extensions on start-upGravatar kwzrd-0/+5
Extensions are no longer bound to their respective seasons.
2020-03-07Deseasonify: move 'SeasonBase' to seasons package initGravatar kwzrd-41/+20
The season module can now be safely deleted, as everything defined here has either been removed or moved elsewhere.
2020-03-07Deseasonify: add `get_extensions` helper functionGravatar kwzrd-1/+20
See docstring for further details.
2020-03-07Deseasonify: move `get_seasons` util function to package initGravatar kwzrd-15/+16
2020-03-07Deseasonify: do not load legacy SeasonManager on start-upGravatar kwzrd-1/+0
2020-03-07Deseasonify: remove `get_season_class` utility functionGravatar kwzrd-7/+0
2020-03-07Deseasonify: remove `get_season` utility functionGravatar kwzrd-33/+0
2020-03-07Deseasonify: remove redundant SeasonBase methodsGravatar kwzrd-181/+0
For now, we will keep the base class with annotated attrs.
2020-03-07Deseasonify: remove SeasonManager cogGravatar kwzrd-138/+1
2020-03-05CI: name the use Python version taskGravatar MarkKoz-0/+1
The name is needed to be able to retrieve its output variable.
2020-03-04CI: run pre-commit hooks in CIGravatar MarkKoz-44/+63
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
2020-03-04Add more pre-commit hooksGravatar MarkKoz-100/+113
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
2020-03-04Update dependenciesGravatar MarkKoz-290/+317
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
2020-03-04(Games Cog): Added space between game search result + removed cutoff in ↵Gravatar Karlis S-2/+2
get_close_matches.
2020-03-04(Games Cog): Moved `string.Template` to `str.format()`, applied changes ↵Gravatar ks123-51/+37
everywhere.
2020-03-04(Games Cog): Moved self.genres to __init__ and added type hints. Added lower ↵Gravatar ks123-3/+3
`difflib.get_close_matches` cutoff from 0.6 (default) to 0.4.
2020-03-04(Games Cog): Replaced - with space in genre aliases, added multiword genres ↵Gravatar ks123-9/+10
support for .games command, modified docstring to explain this and added str.title() to embed title genre showing.
2020-03-04(Games Cog): Remove too much empty lines in .games search command, simplify ↵Gravatar ks123-1/+1
lines.
2020-03-04(Games Cog): Stop refreshing genres task when Cog unloadGravatar ks123-0/+5
2020-03-04(Games Cog): Added try block to genres refresh task.Gravatar ks123-1/+6
2020-03-04(Games Cog): Added .games refresh|r command for refreshing genres.Gravatar ks123-1/+13
2020-03-04(Games Cog): Created task for fetching genres (every hour)Gravatar ks123-2/+7
2020-03-04(Games Cog): Fixed _get_genres function looping over genres (started using ↵Gravatar ks123-5/+5
dict.items())
2020-03-04(Games Cog): Fixed get_games_list calling formatting at L192Gravatar ks123-2/+1
2020-03-02(Games Cog): Fixed companies list generating code (.games <genre> command).Gravatar ks123-3/+2
2020-03-02(Games Cog): Added comments about offsets, use keyword parameters for ↵Gravatar ks123-1/+5
get_companies_list.
2020-03-02(Games Cog): Fixed and added content to docstrings.Gravatar ks123-2/+7
2020-03-01Strip references to seasonalbot chatGravatar S. Co1-15/+12
Redirect any output to seasonalbot commands, where relevant
2020-02-28(Games Cog): Moved layouts, request bodies and URLs to Templates. Added ↵Gravatar ks123-162/+213
token check on load. Other small code improvisations.
2020-02-25Update devlog channel constantGravatar S. Co1-1/+1
The log channels have become one
2020-02-25Added .games command with all it's subcommands, added IGDB token requirement ↵Gravatar Karlis S-19/+4
to constants.py.
2020-02-25Remove keys() from total_rating count (Games Cog)Gravatar Karlis S-1/+1
Co-Authored-By: Thomas Petersson <[email protected]>
2020-02-25Added .games command with all it's subcommands, added IGDB token requirement ↵Gravatar ks123-0/+339
to constants.py.
2020-02-24Added .games command with all it's subcommands, added IGDB token requirement ↵Gravatar ks123-0/+334
to constants.py.
2020-02-23Cycle icons within season in configured interval onlyGravatar kwzrd-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.
2020-02-23Add icon cycle frequency constantGravatar kwzrd-0/+1
2020-02-23Calculate seconds as n_hours * seconds_in_hourGravatar kwzrd-1/+1
This is a lot more readable than just 86400.
2020-02-22Implement in_month command checkGravatar kwzrd-1/+20
Commands decorated with in_month can only be used in one of the allowed months.
2020-02-22Add IntEnum for the 12 monthsGravatar kwzrd-2/+18
This is a safe way to specify which months a command can be used in. The enum's values behave as ints when being passed to the datetime.date initialiser.
2020-02-18Fixed comments in Movie cogGravatar Karlis S-2/+2
2020-02-18Fixed error message for less than 1 movie check.Gravatar Karlis S-1/+1
2020-02-17Added .movies genres|genre|g command. Made .movies command docstring ↵Gravatar ks123-46/+43
smaller. Added warning loggings. Better Some Numbers section formatting.
2020-02-17Lint error - missing lineGravatar F4zii-1/+0