in the updates were for the i18n translation strings the payday command message was accidentally changed to +(amount) (new balance). This changes it back to its original message +(amount) (currency name)
current_build is now set as a dict, but its default was a list.
This resolves the error an `[p]audioset settings`.
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>
Cleanup's helper method to collect messages to delete was incorrectly filtering by check rather than message_filter, causing delete_after to be ignored.
Fix for `playlist list`: added forgotten variable plus return for formatting (fixes#2190)
i18n addditions: DJ Role toggle, Thumbnail display toggle
`audioset settings`: added missed end of line return
`queue` fix: added indentation to not have the currently playing song info repeated in the queue display when playing local songs
`local play` and `local folder` now display the appropriate menu when DJ role is on.
* 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>
[i18n] Improves the coverage and quality of extracted user-facing string literals in the `redbot.core` package and makes them less ambiguous for the translator.
* 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>
* Add files via upload
* Update predicates.py
Changed sender from a discord.Member object to ctx.
Added a channel check.
Combined the same method and channel method into a validator and applied through-out.
valid_role and has_role methods now check for either an id or a name.
contained now uses string.lower() when testing for membership in a collection.
Signed-off-by: Redjumpman <redjumpman@users.noreply.github.com>
Resolves#2160.
Also resolves another issue where the bot will error out when getting the guild's invites when it doesn't have the Manage Server permission.
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>
Use `async with Lock` instead of deprecated `with await lock` usage.
Forces a file fsync prior and a directory fsync (where available) after rename to prevent issues with left behind temp files.
Also should clarify: this is not threadsafe. Comments were clarified, function names remain misleading.
If the member is in the guild, delegates to existing ban logic.
Additionally, check that we have ban perms prior to attempting to fetch the existing ban list.
Fixes#2127.
What's changed:
- Fixed issues mentioned on #2031
- Fuzzy help displays more like help manual
- Fuzzy help is easier and more flexible to use
- Fuzzy help string-matching ratio lowered to 80
- Help formatter is more extendable
- Help command has been optimized, cleaned up and better incorporates fuzzy help
- Added async_filter and async_enumerate utility functions because I was using them for this PR, then no longer needed them, but decided they might be useful anyway.
- Added `Context.me` property which is a shortcut to `Context.guild.me` or `Context.bot.user`, depending on the channel type.