aboutsummaryrefslogtreecommitdiffstats
path: root/bot (follow)
Commit message (Collapse)AuthorAgeLines
* Deseasonify: title-case month names in frontendGravatar kwzrd2020-03-31-2/+2
| | | | | | | After 00af207de3087a41270f216ad86e06ba7dbf9d42, we should ensure that the month names aren't shown to the user in all caps. Co-authored-by: MarkKoz <[email protected]>
* Deseasonify: turn helpers into regular functionsGravatar kwzrd2020-03-31-5/+5
| | | | | | It is not necessary for these to be coroutines. Co-authored-by: MarkKoz <[email protected]>
* Deseasonify: `pop` from remaining icons rather than unpackGravatar kwzrd2020-03-31-1/+1
| | | | | | This should be more readable. Co-authored-by: MarkKoz <[email protected]>
* Deseasonify: delegate refresh to dedicated commandGravatar kwzrd2020-03-31-3/+1
| | | | | | Reduces code duplication. Co-authored-by: MarkKoz <[email protected]>
* Refactor: Github to GitHubGravatar kwzrd2020-03-31-15/+15
| | | | Co-authored-by: MarkKoz <[email protected]>
* Refactor: adjust docstrings based on feedbackGravatar kwzrd2020-03-31-17/+13
| | | | | | | | * Capitalize month names * Add backticks to `sha` attr reference * Avoid misusing the term 'poll' Co-authored-by: MarkKoz <[email protected]>
* Refactor: capitalize AssetType enum membersGravatar kwzrd2020-03-31-6/+6
| | | | Co-authored-by: MarkKoz <[email protected]>
* Refactor: capitalize Month enum membersGravatar kwzrd2020-03-31-31/+31
| | | | Co-authored-by: MarkKoz <[email protected]>
* Deseasonify: resolve current season w.r.t. month overrideGravatar kwzrd2020-03-30-2/+2
| | | | | | | Previously, the env var was only being used for seasonal decorators, not branding. Although for testing purposes, seasons can be easily set via bot commands, it makes sense to also use the env var to choose the current season.
* Deseasonify: move current month resolver to utilsGravatar kwzrd2020-03-30-18/+19
| | | | | The function is useful to other modules as well - not only decorators. This declares it as public and moves it to a more accessible place.
* Deseasonify: remove `autostart` env varGravatar kwzrd2020-03-30-1/+0
| | | | | | Constant is no longer used. See: 9259f985e6e327a522b4420c879a50cb4f75a09d
* Deseasonify: add persistent branding configurationGravatar kwzrd2020-03-30-5/+31
| | | | | | | | | | | | | | | | | | | | A persistent config file will remember whether the daemon is supposed to be running, or not. This means that instead of relying on the env variable, the daemon can be turned on or off "once and for all" via a command, and will not violate this decision on restart. This effectively deprecates the `Branding.autostart` env var. It is believed that having two ways to configure the same thing would be more confusing than useful. The env var will be removed. The two helper functions for reading and writing have been implemented in a generic manner, meaning that should a new config key be added in the future, the helpers shouldn't require any further adjustments. Suggested by lemon and scragly. Co-authored-by: Leon Sandøy <[email protected]> Co-authored-by: scragly <[email protected]>
* Deseasonify: add default persistent config file for branding cogGravatar kwzrd2020-03-30-0/+3
|
* Deseasonify: add helper func to resolve current monthGravatar kwzrd2020-03-29-3/+17
| | | | See docstring for details.
* Deseasonify: validate configured month overrideGravatar kwzrd2020-03-29-0/+6
|
* Deseasonify: add `month_override` env varGravatar kwzrd2020-03-29-0/+2
|
* Deseasonify: use `self` rather than local `bot` instance varGravatar kwzrd2020-03-29-3/+3
|
* Deseasonify: adjust bot method defs to a more logical orderGravatar kwzrd2020-03-29-33/+33
|
* Deseasonify: use new `_apply_asset` setterGravatar kwzrd2020-03-29-54/+26
| | | | | | | | The diff should demonstrate how much code repetition we prevent. We do not make use of `_apply_asset` for nickname changes - due to the comparative simplicity and conceptual difference, this method provides its own error handling.
* Deseasonify: implement generic media asset setterGravatar kwzrd2020-03-29-2/+30
| | | | | | | | | | | | | | | | Current `set_avatar`, `set_icon` and `set_banner` methods are almost identical - they only differ in the type of asset they upload. This leads to a lot of code repetition, especially w.r.t. error handling. We instead add a generic method that is parametrized by an AssetType param, and by the target entity (i.e. bot, or guild) that the asset should be applied to. All error handling can then be done in one place. Error handling methodology is adjusted - instead of suppressing errors, we catch and log them. Since we no longer determine whether the upload succeeded based on 'before' != 'after', this solves a bug where re-applying the same asset resulted in a warning-level log, triggering Sentry.
* Deseasonify: add AssetType enumGravatar kwzrd2020-03-29-2/+14
|
* Deseasonify: reduce icon shuffle log verbosityGravatar kwzrd2020-03-29-1/+1
| | | | | It is not necessary to log all icon paths on each shuffle. Creates unnecessary visual clutter in the logfile.
* Deseasonify: remove unused `set_username` methodGravatar kwzrd2020-03-29-30/+0
| | | | | | | The method is a left-over from the old seasonal system. We no longer use it, the bot's username never changes, only the nickname. The amount of internal branching logic makes it difficult to maintain.
* Deseasonify: re-order command defs for consistency with docGravatar kwzrd2020-03-28-52/+52
| | | | | | | | Define commands in the same order in which the cog's docstring lists them. This shall make it easier to browse or look up implementations. The commands are defined roughly in the order in which a user would be expected to use them.
* Deseasonify: add cmd showing all available seasonsGravatar kwzrd2020-03-28-1/+24
|
* Deseasonify: add helper to give all available seasonsGravatar kwzrd2020-03-28-1/+6
|
* Deseasonify: log in `add_cog` rather than in each `setup`Gravatar kwzrd2020-03-28-55/+9
| | | | | | | | | | | | The previous system required each extension's `setup` func to log that the cog was loaded. This leads to inconsistent messages all trying to convey the same thing, variable logger names in the output file are difficult to read, and several extensions were not logging at all. By logging directly in the `add_cog` method, we reduce code repetition, ensure consistent format, and remove the responsibility to remember that a log should be made.
* Merge master: sentry sdk, updated contributing docsGravatar kwzrd2020-03-28-1/+34
|\
| * Setup SentryGravatar Joseph Banks2020-03-25-1/+34
| |
* | Deseasonify: make `get_extensions` an iteratorGravatar kwzrd2020-03-28-12/+15
| | | | | | | | Simplify internal structure & adjust var naming.
* | Deseasonify: make `get_package_names` an iteratorGravatar kwzrd2020-03-28-10/+6
| | | | | | | | | | This simplifies the function and is more in-line with how the function is being used.
* | Deseasonify: rename utility functionGravatar kwzrd2020-03-28-5/+5
| | | | | | | | | | To avoid confusion, the packages should no longer be referred to as 'seasons'.
* | Deseasonify: separate seasonal definitions into new moduleGravatar kwzrd2020-03-28-168/+160
| | | | | | | | | | | | | | | | | | Since the original `seasons` package is now called just `exts`, it makes sense to migrate all season-specific definitions out into a separate module. This module now contains everything relating to 'new' seasons, i.e. just branding tooling.
* | Deseasonify: rename `seasons` pkg to `exts`Gravatar kwzrd2020-03-28-9/+9
| | | | | | | | | | | | | | | | | | 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-2/+0
| |
* | Deseasonify: move help extension under evergreen pkgGravatar kwzrd2020-03-28-1/+0
| |
* | Deseasonify: move decorators module under utilsGravatar kwzrd2020-03-28-16/+16
| |
* | Deseasonify: move pagination module under utilsGravatar kwzrd2020-03-26-6/+5
| |
* | Deseasonify: move exceptions module under utilsGravatar kwzrd2020-03-26-2/+2
| |
* | Deseasonify: ignore dirs in server icons dirGravatar kwzrd2020-03-26-3/+8
| | | | | | | | | | | | | | | | | | | | As per Scrags' & Lemon's request, icon discovery will ignore directories in the branding repo's `server_icons` directory, so that unused files can be placed there without interfering with the bot's discovery mechanism. Co-authored-by: scragly <[email protected]> Co-authored-by: Leon Sandøy <[email protected]>
* | Deseasonify: use help-friendly docstring summariesGravatar kwzrd2020-03-26-8/+29
| | | | | | | | | | | | | | | | Clean up the summary docstring lines such that they read better in the automatically generated help embed. Extend some of the docs so that they provide information that may be useful to users unaware of the internal implementation.
* | Deseasonify: show help on group invokeGravatar kwzrd2020-03-26-13/+14
| | | | | | | | | | | | | | | | | | | | Previously, when a group was called without a specific subcommand, the status / info command was invoked automatically. This was inconsistent with how other cogs behave, and makes it difficult to discover the full API. The logic from the `daemon` group is split off into a separate cmd to allow this behaviour.
* | 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: extend `in_month` docGravatar kwzrd2020-03-26-0/+5
| |
* | Deseasonify: add 'task' alias to daemon groupGravatar kwzrd2020-03-25-1/+1
| | | | | | | | | | | | Suggested by Scrags. Co-authored-by: scragly <[email protected]>
* | Deseasonify: remove outdated `devtest` channel constantGravatar kwzrd2020-03-24-2/+0
| | | | | | | | | | | | | | This channel no longer exists and creeps into error messages as #deleted-channel. Fixes: #335
* | Deseasonify: clean up `constants` moduleGravatar kwzrd2020-03-24-27/+45
| | | | | | | | | | | | | | Order config classes and constants alphabetically (within groups). Add missing classes to `__all__`, and style it as a vertical list. This will make it easier to maintain, and allows it to serve as a summary of the module's contents.
* | Deseasonify: move bookmark icon under `Icons` constantsGravatar kwzrd2020-03-24-8/+6
| |
* | Deseasonify: use 't-dot' notation for type annotationsGravatar kwzrd2020-03-24-19/+19
| | | | | | | | | | The module is full of complicated annotations, and the full `typing` takes up annoyingly much visual space.