aboutsummaryrefslogtreecommitdiffstats
path: root/bot/utils (follow)
Commit message (Collapse)AuthorAgeLines
* Adds Link Suppressing HelperGravatar Hassan Abouelela2021-04-23-0/+8
| | | | | | Adds a helper to find and escape links in a message. Signed-off-by: Hassan Abouelela <[email protected]>
* Replace list comp with a set update + sequenceGravatar Chris2021-03-21-1/+1
|
* Only output override channels & bot commands channel on whitelist errorGravatar Chris2021-03-20-1/+7
| | | | | | | | Previously this would output all channels, and could result in an error. This change ensures only the main bot channel & and any overridden channels are shown in the embed. We do this before the categories block as the categories kwarg itself is an override, so we want to include those in any output.
* master => mainGravatar Joe Banks2021-03-13-1/+1
|
* make invoke_help_command only take ctxGravatar ToxicKidz2021-03-13-3/+3
|
* Make flake8 happy again.Gravatar ToxicKidz2021-03-12-1/+2
|
* Make flake8 happy.Gravatar ToxicKidz2021-03-12-5/+2
|
* make utility invoke_help_command functionGravatar ToxicKidz2021-03-12-0/+12
|
* Merge branch 'master' into masterGravatar scragly2021-03-08-48/+71
|\
| * Adds Category Channels To Error MessageGravatar Hassan Abouelela2021-02-07-1/+12
| | | | | | | | | | | | | | Adds the channels within categories to the failure message of the command whitelist check. Signed-off-by: Hassan Abouelela <[email protected]>
| * Overhauls In Channel CheckGravatar Hassan Abouelela2021-02-07-49/+61
| | | | | | | | | | | | | | Upgrades in channel check to support categories, and in the case of overrides, roles too. Signed-off-by: Hassan Abouelela <[email protected]>
* | Merge branch 'master' into masterGravatar Matteo Bertucci2020-11-30-96/+215
|\|
| * Remove references to old name.Gravatar Leon Sandøy2020-11-21-1/+1
| | | | | | | | | | I've tried to replace this with generic references where appropriate, but a lot of the time it just doesn't make a lot of sense to do so.
| * Get rid from branding management stuffGravatar ks1292020-11-17-27/+1
| |
| * Remove persist bot utilGravatar Jeremiah Boby2020-11-14-69/+0
| |
| * Rename BetterMessageConverter -> WrappedMessageConverterGravatar bast2020-09-29-1/+1
| |
| * Add more docstrings and flake8 cleanupGravatar bast2020-09-25-3/+4
| |
| * Make .bm handle embed-suppression syntax for message links <link>Gravatar bast2020-09-25-0/+15
| | | | | | | | [link] and [<link>] are also supported
| * Add extensions.py fileGravatar Gustav Odinger2020-09-21-0/+34
| | | | | | | | | | | | - Necessary for extensions.py to work - Fully copied over from the 'Python' bot
| * Add checks.py fileGravatar Gustav Odinger2020-09-21-0/+164
| | | | | | | | | | | | - Necessary for extensions.py to work - Copied from the 'Python' bot, with minor tweaks to make it work with SeasonalBot
* | Add time utilsGravatar AtieP2020-09-28-0/+84
|/
* Update bot/utils/randomization.pyGravatar Xithrius2020-09-10-1/+5
| | | Co-authored-by: Dennis Pham <[email protected]>
* Added RandomCycle utility to jump between set indexes repeatedly.Gravatar Xithrius2020-09-09-0/+19
|
* Remove redundant f-stringsGravatar MarkKoz2020-07-14-3/+3
| | | | This fixes a new lint error (F541) introduced by flake8 3.8.
* Remove accidental extra word from docstringGravatar kwzrd2020-05-25-1/+1
|
* 5/24 - bot utils - added encoding, and notes for persistGravatar jodth072020-05-24-1/+4
|
* (Minesweeper): Moved `UserNotPlayingError` to `bot.utils.exceptions`, ↵Gravatar ks1292020-04-08-0/+6
| | | | removed definition in extensions. Removed custom error handler.
* Deseasonify: implement __str__ for Month enumGravatar kwzrd2020-04-01-11/+15
| | | | | | | | This way, we can standardize the way Months are shown to both the user and the developer. Note that if passing a Month member to an f-string, the `!s` format code must be specified to ensure our __str__ is used. Co-authored-by: MarkKoz <[email protected]>
* 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: add helper func to resolve current monthGravatar kwzrd2020-03-29-3/+17
| | | | See docstring for details.
* Deseasonify: rename utility functionGravatar kwzrd2020-03-28-2/+2
| | | | | To avoid confusion, the packages should no longer be referred to as 'seasons'.
* Deseasonify: rename `seasons` pkg to `exts`Gravatar kwzrd2020-03-28-1/+1
| | | | | | | | | 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: move decorators module under utilsGravatar kwzrd2020-03-28-0/+321
|
* Deseasonify: move pagination module under utilsGravatar kwzrd2020-03-26-1/+431
|
* Deseasonify: move exceptions module under utilsGravatar kwzrd2020-03-26-0/+4
|
* Deseasonify: improve `get_seasons` convenience functionGravatar kwzrd2020-03-21-2/+2
|
* Deseasonify: move `get_seasons` util function to package initGravatar kwzrd2020-03-07-1/+1
|
* Add context manager to safely unlock role mentionabilityGravatar Sebastiaan Zeeff2019-12-04-0/+23
| | | | | | | | | | | | | | | | | | | | Currently, our regualar roles are not mentionable by default. This means that features that rely on roles to keep track of users that want to receive announcements, like the AoC Day Countdown, don't actually ping the users subscribed to it. The solution is obviously that the bot should unlock prior to making the announcement. However, this is complicated by the fact that there needs to be a sufficient delay. both between unlocking and sending the message and between sending the message and locking the role again. If not, Discord's not done synchronizing across all servers and some users won't receive a ping. To make this easier, I have implemented a context manager that takes an instance of `discord.Role` and an optional `delay` (default: 5s) that yields a context in which the role is unlocked. This context manager also makes sure that the role is locked even if an exception occured within the unlocked context.
* Use mkdir exists kwarg instead of checking existing ahead of time.Gravatar scragly2019-09-23-4/+2
|
* Improve func name, example, directory managementGravatar scragly2019-09-23-9/+37
| | | | | | | | | | | | | | | | | | | | Function name has been changed to `make_persistent` after prompt by @lemonsaurus asking for a more descriptive name. Thanks @MarkKoz for providing the alternate name. During local testing, the `data` directory doesn't exist yet. In prod, this isn't an issue as the persistent volume is mounted at that location. To make local testing more convenient, the directory is checked and made if not found. Persistent data files will be placed in a seasonal subdirectory so long as they have a valid season name somewhere in their path, otherwise they will be placed directly in the data directory. Added a note to docstring to avoid same-named files in the same seasons or it will conflict with each other in the persistent data directory. The example was extended a little bit to make it both actually valid if tested and hopefully make it easier to understand what's going on.
* Check explicitly if file exists rather than any existing path.Gravatar scragly2019-09-23-1/+1
| | | Co-Authored-By: Mark <[email protected]>
* Add better explanatory docstring and example for persist.datafile.Gravatar scragly2019-09-20-1/+17
|
* Add persistent datafile utils.Gravatar scragly2019-09-19-0/+24
|
* Fix incorrect merge conflict resolutions, lint remaining itemsGravatar S. Co12019-09-11-1/+1
|
* Lint remaining filesGravatar S. Co12019-09-09-6/+6
| | | hacktoberstats cog handled in separate PR
* Merge pull request #260 from kosayoda/text-modifyGravatar Mark2019-09-03-0/+56
|\ | | | | Modify text :-)
| * Add utils function to replace multiple words in a given stringGravatar kosayoda2019-08-18-0/+56
| |
* | Replace paramater and return value docstring documentation with an extended ↵Gravatar kosayoda2019-08-19-11/+5
|/ | | | summary
* Relint Seasonalbot with new linting rulesGravatar sco12019-04-24-4/+0
|
* Docstring pass for Halloween cogsGravatar sco12019-03-19-5/+12
|