* Add inviteset group command
* Fix errors
* Fix line break
* Remove user bot support
* Fix docstrings line breaks
* Remove embed specific formatting
* Remove invite redirect
* Add self argument to _can_get_invite_url
* Remove unused import
* fix errors related to classes + double help
* Removed self bot support
* same stuff, but with some more spurious error supression
* fix issue in permissions found in this
* fix a few more spurious errors
* fix another issue
* semi-spurious error fixes
* .
* formatting
* move this to properly log
* distutils import + virtualenv
* more fixes
* [Help] Add settings for various things
- Fixes a small issue in a previously not-exposed logic path
- Fixes an issue with denied commands help invocation
- Adds some global usage settings
* remove outdated comment
* improve intent of strings
* added punctuation
* Add DM forbidden handling
* use a slightly different method for shortening embed width specifically
* Adds a check to [p]set locale
Fixes#2552
I would like a little bit of feedback on this change.
- Right now, `locale_name` is case sensitive. Should that remain case sensitive or should I allow it to accept it case insensitively?
- I made the invalid locale string an i18n string, however I don't know the process for how those are supposed to be made or if that will break anything. Should that remain an i18n string or should I make it a normal string?
* Case insensitivity and explicit en-US
-`[p]set locale` is now case insensitive
-`en-US` added to `[p]listlocales` instead of only existing in `[p]set locale`'s help text
* Remove spacing
This creates a central location to store external API tokens that can be used between cogs without requiring each cog to be loaded for it to work.
A new set option for `[p]set api` is created to assist in forming bot readable API token locations.
This also updates the Streams cog to utilize the central database.
Tokens are moved from the old data locations in core cogs on load.
Allows cog creators to explain clearly why a cog cannot load by raising `redbot.core.errors.CogLoadError`. Instead of having to check in the console what's wrong, the message will directly be sent in the context channel.
Resolves#2094.
This command needs some more fixing and cleaning up than this, this is just a simple bugfix which gets it mostly working for now.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Implements our required subset of PEP 440 in redbot.core.VersionInfo
* Added unit tests for version string parsing and comparisons
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>
* [i18n] Use redgettext over pygettext
* Clear out autogenerated `messages.pot` files
* Remove redundant `regen_messages.py` files
* Refactor `generate_strings.py` to use redgettext
* Install redgettext in Travis Crowdin job
* Clean up some problematic usages of gettext function
* Reformat
* Replace generate_strings.py with Makefile argument
* Update to redgettext 2.1, use exclusion pattern
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Handle missing cogs correctly, add some helpful algorithms
For cog loading, only show "cog not found" if the module in question was the one
that failed to import. ImportErrors within cogs will show an error as they should.
- deduplicator, benchmarked to be the fastest
- bounded gather and bounded async as_completed
- tests for all additions
* Requested changes + wrap as_completed instead
So I went source diving and realized as_completed works the way I want it to,
and I don't need to reinvent the wheel for cancelling tasks that remain
if the generator is `break`ed out of. So there's that.