* Add to index, url matching links, and add link to customcommands.rst
* Some docstring rewriting
* Adding arguments and more details.
* Handle aliases, rest of arguments and examples.
* Black formatting
* Switch to alphabetical
* Apparently forgot to regenerate this.
* Update redbot/cogs/customcom/customcom.py
Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>
* Update docs/cog_guides/customcommands.rst
Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>
Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>
[Core] Data Deletion And Disclosure APIs
- Adds a Data Deletion API
- Deletion comes in a few forms based on who is requesting
- Deletion must be handled by 3rd party
- Adds a Data Collection Disclosure Command
- Provides a dynamically generated statement from 3rd party
extensions
- Modifies the always available commands to be cog compatible
- Also prevents them from being unloaded accidentally
* create cog disbale base
* Because defaults...
* lol
* announcer needs to respect this
* defaultdict mishap
* Allow None as guild
- Mostly for interop with with ctx.guild
* a whitespace issue
* Apparently, I broke this too
* Apply suggestions from code review
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* This can probably be more optimized later, but since this is a cached value, it's not a large issue
* Report tunnel closing
* mod too
* whitespace issue
* Fix Artifact of prior method naming
* these 3 places should have the check if i understood it correctly
* Announce the closed tunnels
* tunnel oversight
* Make the player stop at next track
* added where draper said to put it
* Apply suggestions from code review
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Reserves command names
- Currently, only reserving ``cancel``
- This should only impact matching command qualified names
- This also checks aliases
- This makes cc and alias use the new module constant with info about
this
- Module constant is available for use by 3rd party cogs which may
dynamically create responses.
* Change misleading var name
* style
* Thanks Flame!
* Handles issues with CC
* Add respectable aliases for consistency
* General command name for alias.py
* Forgot one for alias
* General command for filter
* General command for warnings
* Whoops
Resolves#1749
* 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
Also included a Makefile recipe which makes use of the Crowdin CLI's `crowdin download` command. This requires whoever is using it to provide the project's API key in an environment variable, but we may automate this at some point.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
Uses a menu, optionally embedded with respect to the embed settings, for scrolling through the custom command list, each cc with a ~50 character preview. Format is purposefully similar to the help menu.
Resolves#2104.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
The new `redbot.core.commands.converter` module was causing default converters to never be found.
Also cleaned up some of the other code (made some methods static, fixed some typing violations)
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>
* [V3 CustomCom] Custom Command Parameters
Allows specifying more parameters for CC's via {0}, {1}, etc. that will be filled by the user invoking the CC. Python-style type hinting and attribute access is also allowed for Discord and builtin types.
> [p]cc add simple greet Hi, {0.mention:Member}!
> ...
> [p]greet zephyrkul
> Hi, @zephyrkul!
The bot will reply with the standard help messages if the cc is incorrectly executed.
> [p]greet me
> Member "me" not found
* black formatting
* check command failure
Only call the custom command if the faked command succeeded.
* misc fixes
1) don't str.strip all the time, it's not family-friendly and doesn't match transform_parameter
2) transform_arg now actually returns strings in every case
3) improve prepare_args parsing security
4) help parameters will show what type they expect
5) make linter less angery
* customcom documentation
I hate rst
* don't require repeated type hinting
If a parameter was type hinted previously, don't require it again.
Ex: `{0.display_name:Member}#{0.discriminator}` is now possible.
* add cog_customcom.rts to index
I despise rst
* don't enforce order
Allow type hinting and attribute access to be in either order.
Ex. `{0:Member.mention}` is now valid.
* clean up on_message
We're building context anyway, may as well use it.
* [doc] correct cog name
Cog class is named CustomCommands, not CustomCom
* minor on_message optimization
only build context if it's needed
* update cc_add docstring
Old one wasn't user-friendly. Replaced with a link to the new docs.
Link will not function until PR is merged and docs refreshed.
* [doc] change repeat to say
repeat is an audio command, use say in the example instead
* compare ctx.prefix to None
allows for null prefixes, which is a bad idea but who am I to judge
* address review
* raise error on conflicting colon notation
bugfix I was working on but failed to actually commit
* Cleanup quotes in cogs
* More quote cleanup that I missed
fixed a little bit of grammar here and there as well.
* [V3 Warnings] Change allowcustomreasons docstring
To help not confuse users who would believe that the command would use allow or disallow.
* Run black reformat
* Update travis to not sip pipfile lock
update pipfile dependencies
additional black formatting pass to conform to black 18.5b
* .
* pin async timeout until further discussion of 3.5 support
* .