* Use aware objects instead of naive ones
* Use aware objects when storing and reading UTC timestamps
* Remove unneeded parentheses
* Fixed naive and aware objects unable to be compared here
* Address feedback
* Fix the newly added `modlog.create_case()` calls
Co-authored-by: jack1142 <6032823+jack1142@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
* Handle the ints for user objects in Modlog appropriately (#3784)
* God, this is stupid
* Add logging of unexpected exceptions
* Add more specific info for Forbidden error
* add i18n support
* Lets normalize how we name config attributes across the bot.
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* ....
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* nothing to see here
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* do better with loop cleanup
* changelog
* remove redundant line
* Do this a bit better than the initial pass
* Improve windows support
Make some other things coroutines to work with improved design
* Wish we'd have done this right from the start...
* Update deps surrounding this
- see bpo-23057
- neccessary for windows users
- nice for consistent support channel info / feature availability
* dep issue
* Fix tests
* duplication plugin py version
* actually handle this
* Reconfigure some checks with codeclimate, disable pylint for now
* style
* Is my exasperation showing yet?
* handle some stupid stuff
* meh
* dep changelog
* I know this needs a changelog entry and docs still
* update tests for new behavior
* update docs, filter; add changelog
* Ready for review
* stop fetching the same Audit logs when the bot is the mod
* I forgot to press save
* fix a comprehension
* Fix AttributeError
* And the other place that happens
* timing fixes
* [ModLog] Prevent duplicate kwarg error
The `name` key used to be set in the Config for casetypes.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Don't mutate `data` argument
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
### Replacement for pipenv's environment setup
First of all, there's a new Make recipe for all devs and contributors on both Windows and Posix, `make setupenv`, which is kind of a replacement for `pipenv install --dev`. It creates a virtual environment in `.venv` using the inbuilt `venv` module, clearing out any existing virtual environment if needed first. Then it installs all dev dependencies using our new `dev-requirements.txt` file. `CONTRIBUTING.md` has been updated to reflect all of this.
### Dependency version bumping tool
Secondly, I've added a python script, `tools/bumpdeps.py` to help with bumping dependency versions. It has its own Make recipe too, `make bumpdeps`. This script won't work on Windows (yet). It reads the `tools/primary_deps.ini` file, which contains the primary requirements of Red and its extras with loose version specifiers, and outputs all pinned dependencies, in `setup.cfg` format. It's not a foolproof dependency resolver, it's quite simple, but it's bound to help out a lot. It'll try to give warnings if there might be a version conflict, but updating `setup.cfg` with its output and then doing `pip install -r dev-requirements.txt` will allow pip to issue warnings if something is conflicting.
So to add a new dependency, add it to `tools/primary_deps.ini` in the appropriate place, and either use `make bumpdeps` to completely update all dependencies, or simply add it to `setup.cfg` manually with its sub-dependencies, and all versions pinned.
### Sphinx 2.1.2 (docs changes)
The sphinx update brought along the ability to disable type annotations being rendered in function and method signatures, and I have gladly gone and done that. Type annotations should already be specified under the "Parameters" section, and the way sphinx renders them in function signatures makes them much harder to read.
Also, documented classes will now display what classes they inherit from.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
Modlog was the biggest culprit for seriously large documents in the MongoDB backend, since it stored all cases as nested dicts in the guild scope. So, for example, on the Fortnite server, the guild document for Kowlin's bot had exceeded 8MB.
This commit gives each case its own document. It also does the same for casetypes. Not only does it remove the possibility of the document exceeding the maximum size in MongoDB, it's also just more efficient for all backends.
Other misc changes: Fixed a bunch of type-hints, and also added more support for when an object related to a case (user, moderator, channel etc.) can't be found (because it was deleted or something rather)
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* 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
* Add output sanitization defaults to context.send
Add some common regex filters in redbot.core.utils.common_filters
Add a wrapper for ease of use in bot.send_filtered
Sanitize ModLog Case's user field (other's considered trusted as moderator input)
Sanitize Usernames/Nicks in userinfo command.
Santize Usernames in closing of tunnels.
* Add documentation
* prevent the bot from being a modlog target
* prevent heirarchy issues in mod
* modify this comparison to avoid more complex mocking of the guild object in mod test
* spelling
* Give modlog case objects the bot as an attribute
* Dispatch modlog_case_create and modlog_case_edit events
* case.bot, not just bot
* fix a couple more issues resulting from refactor
* Case.edit doesn't need the bot parameter lol
* Make create_case return the case object (because tests)
* Modify create_case docstring
* Fix a docstring
* [V3 CogManagerUI] implement text-only support in [p]cogs
* Change page length to 1800 + workaround for pages starting with delim
* [V3 Core] text mode support for [p]contact and [p]dm
* Implement text-only support in modlog and fix everything that broke because of it
* Fix modlog stuff in filter too
* Fix tests
* Implement optional embed support in [p]help
* move to .format
* 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