* Dependency update
discord.py==1.0.1
websockets<7
[style]
black==19.3b0
[Docs]
jinja==2.10.1
urllib3==1.24.2
Changes related to breaking changes from discord.py have also been made
to match
As of this commit, help formatter is back to discord.py's default
* Require custom group initialization before usage and write that data to disk
* Style
* add tests
* remove custom info update method from drivers
* clean up remnant
* Turn config objects into a singleton to deal with custom group identifiers
* Fix dumbassery
* Stupid stupid stupid
This is a safety measure to prevent accidentally passing a model which has the same name as another model, potentially modifying rules for the unwanted one.
This was thrown when the "default" key existed and Permissions tried to iterate over the list mapping keys as ints.
Also fixed some issues with saving config with keys as `int` instead of `str`.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Uses classmethods to create predicates
* Classmethods allow using a combination of different parameters to describe context
* Some predicates assign a captured `result` to the predicate object on success
* Added `ReactionPredicate` equivalent to `MessagePredicate`
* Added `utils.menus.start_adding_reactions`, a non-blocking method for adding reactions asynchronously
* Added documentation
* Uses these new utils throughout the core bot
Happened to also find some bugs in places, and places where we were waiting for events without catching `asyncio.TimeoutError`
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
API changes:
- Cogs must now inherit from `commands.Cog` (see #2151 for discussion and more details)
- All functions which are not decorators in the `redbot.core.checks` module are now deprecated in favour of their counterparts in `redbot.core.utils.mod`. This is to make this module more consistent and end the confusing naming convention.
- `redbot.core.checks.check_overrides` function is now gone, overrideable checks can now be created with the `@commands.permissions_check` decorator
- Command, Group, Cog and Context have some new attributes and methods, but they are for internal use so shouldn't concern cog creators (unless they're making a permissions cog!).
- `__permissions_check_before` and `__permissions_check_after` have been replaced: A cog method named `__permissions_hook` will be evaluated as permissions hooks in the same way `__permissions_check_before` previously was. Permissions hooks can also be added/removed/verified through the new `*_permissions_hook()` methods on the bot object, and they will be verified even when permissions is unloaded.
- New utility method `redbot.core.utils.chat_formatting.humanize_list`
- New dependency [`schema`](https://github.com/keleshev/schema)
User-facing changes:
- When a `@bot_has_permissions` check fails, the bot will respond saying what permissions were actually missing.
- All YAML-related `[p]permissions` subcommands now reside under the `[p]permissions acl` sub-group (tbh I still think the whole cog has too many top-level commands)
- The YAML schema for these commands has been changed
- A rule cannot be set as allow and deny at the same time (previously this would just default to allow)
Documentation:
- New documentation for `redbot.core.commands.requires` and `redbot.core.checks` modules
- Renewed documentation for the permissions cog
- `sphinx.ext.doctest` is now enabled
Note: standard discord.py checks will still behave exactly the same way, in fact they are checked before `Requires` is looked at, so they are not overrideable.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* basic caching layer
* bit more work, now with an upper size to the cache
* cache fix
* smarter cache invalidation
* One more cache case
* Put in a bare skeleton of something else still needed
* more logic handling improvements
* more work, still not finished
* mass-resolve is done in theory, but needs testing
* small bugfixin + comments
* add note about before/after hooks
* LRU-dict fix
* when making comments about optimizations, provide historical context
* fmt pass
* This starts setting up checks.py to handle managed permission overrides
* A decent starting point, more work to come
* missing else fix
* more work on this
* reduce redundant code
* More work on this...
* more progress
* add a debug flag to some things in .resolvers to help with exploring why checks behave in a certain way
* modify this to be a list for ease of showing full resolution order
* more
* don't bypass is_owner, ever
* remove old logic about ownercommands
* better handling of chec validity
* anonymous functions return None for __module__, remove some code as a result
* mutable default bind fix
* Add a caching layer (to be invalidated as needed)
Ensure checks in the chain inserted before the core logic only return None or False
(whitelists then blacklists are checked first in core logic, from most to least specific scope, overriding this with an allow does not make sense)
* more progress, slow work as I have time
* Modifies the predicates so that their inner functions are accesible from cogs without
being a check
* Update checks.py
Safety for existing permissions.py cogs
* This is where I take a change of course on setting this up,
because this would have been the most long winded interactive command ever as
it was starting to progress.
This is going to support individual entry updates, settings from yaml, gettings, and clearing existing settings
as well as printing a settings template out and referring people to what is going to be very well written docs
* block permissions cog from being unblocked by the permissions cog as a safety feature (really, co-owner exists at this point)
* WIP
* Okay, this has the intent of the changes, just to actually test these as working as intended + add corresponding guild functions
* oh nice, missed a couple files, sec...
* WIP, also, something's broken in resolvers or check_overrides >>
* This is working now (still needs docs and more...)
* unmerge changes from other PR
* is_owner still needs to exist in here due to management of non checked commands
* Update this to new style standards
* forgot to commit some local changes earlier
* fix update logic
* fix update logic
* b14 fix, lol
* fix issue with management command name
* this isnt a real fix
* Ok..
* perms
* This is working, but needs docs and more configuration opts now
* more
* Ux functions, need testing
* style
* fix using the obj str rather than the id
* fix CogOrCommand converter
* Return the correct things in the converter
* last fix, needs docs, and possibly some extra Ux utils
* start doc writing
* extra user facing commands
* yaml docs
* yaml fix
* secondary checks-fix
* 3rd party check stuff
* remove warning that this isn't ready yet
* swap ctx.tick for real responses, require emoji perms for interactive menuing, better attr handling for nicknames
* send file to author
* alias to `p`
* more ctx tick removal
(This is a long ass changelog...)