* [i18n] Update translation catalogs
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Install redgettext 3.1 in travis crowdin deployment
Last time the catalog templates were updated, redgettext 3.0 was used. I'd rather Travis didn't upload them after extracting with an older version.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* 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
* Add `[p]cleanup between`
At the moment, only deletes the messages in between, does not delete the messages specified when running the command.
* Create converter for message IDs; remove f-strings; use converters in a few extra commands
* Sacrifice to the style gods
* 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>
Cleanup's helper method to collect messages to delete was incorrectly filtering by check rather than message_filter, causing delete_after to be ignored.
* 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>
* Revert "[Cleanup] Hotfix for [p]cleanup after (#2004)"
This reverts commit 7959654dc80c68c46e9c965320322f0d6bfde446.
* refactor cleanup
* formatting pass
* put back in try/except block
* 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
* .
* This sets the default behavior for `get_messages_for_deletetion()` to not include pinned messages, while providing a way to override that
resolves#1589
* actually make commands parse for pinned deletion
* fix capitalization
* Framework for internationalised command help
* Translator for class docstring of cog
* Remove references to old context module
* Use CogManagerUI as PoC
* Replace all references to RedContext
* Rename CogI18n object to avoid confusion
* Update docs
* Update i18n docs.
* Store translators in list instead of dict
* Change commands module to package, updated refs in cogs
* Updated docs and more references in cogs
* Resolve syntax error
* Update from merge
* [V3 Cleanup] refactor to consolidate duplicate code
* [V3 Cleanup] make the prompting function a staticmethod
* Drop continuing message + add punctuation to docstrings
* Add prompt if message deletion > 100
As per issue #1295.
Add's the prompt "Are you sure you want to delete {number} messages? (y/n)"
* added checks and deletes "Continuing" message
phew
* removed unneeded delete()
Removed the unneeded code
* Readd work due to redoing branch
* [modlog] Move to core and start work on separating it from cogs
* More work on modlog separation
* [Core] Finish logic for modlog, do docstrings, async getters
* [Core] Add stuff to dunder all
* [Docs] Add mod log docs
* [Core] Move away from dunder str for Case class
* [Docs] don't need to doc special members in modlog docs
* More on mod log to implement commands
* More work on Mod
* [Mod] compatibility with async getters
* [Tests] start tests for mod
* [Tests] attempted fix
* [Tests] mod tests passing now!
* [ModLog] update for i18n
* modlog.pot -> messages.pot
* [Mod] i18n
* fix getting admin/mod roles
* Fix doc building
* [Mod/Modlog] redo imports
* [Tests] fix imports in mod tests
* [Mod] fix logger problem
* [Mod] cleanup errors
* A couple of bug fixes
Async getters, some old `config.set` syntax
* Filter ignores private channels
* Fix softban
Was still relying on default channels
* Actually ignore private channels
* Add check for ignored channels
* Fix logic for ignore check
* Send confirm messages before making case
* Pass in guild when setting modlog
* Thanks autocomplete
* Maintain all data for case
* Properly ignore softbans in events
* [Mod] bugfixes
* [Mod] more changes
* [ModLog] timestamp change
* [Mod] split filter and cleanup to their own cogs + regen messages.pot
* [Cleanup] change logic
* [Cleanup] increase limit for channel.history
* [Mod] await getter in modset banmentionspam
* [Mod] attempt duplicate modlog message fix
* [Mod] get_user -> get_user_info
* [Modlog] change reason command so the case author can edit their cases (#806)
* [Modlog] make reason command guild only
* [Modlog] clarify the reason command's help
* [Mod] package path changes + numpy style docstrings for modlog
* [Mod] change ban and unban events to need view audit log perms to find/create a case
* [Modlog] refactoring
* [Filter] add autoban feature
* [Mod] update case types + event changes
* [Mod/Modlog] fix tests, fix permissions things
* [Docs] fix up modlog docs
* Regenerate messages.pot