* Rename `bot.db` as `bot._config`
- Continues work towards strong version guarantees
- Added methods for cog use for a few things which were previously
only accessible via direct access.
- Retained private use in a few internal use locations, though most
methods were updated away from this.
- Updated documentation for shared api token users
* changelog
* more detail
* docstring fixes
* Apparently, I forgot to commit something I had locally
- + a copy/paste failue in the changelog
* *sigh*:
* *sigh*
* Catch discord.errors.Forbidden when DMing a user the invite message
Uses the same error message as `[p]help`
* Create 2948.bugfix.rst
* You saw nothing
* PostgreSQL driver and general drivers cleanup
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Make tests pass
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Add black --target-version flag in make.bat
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Rewrite postgres driver
Most of the logic is now in PL/pgSQL.
This completely avoids the use of Python f-strings to format identifiers into queries. Although an SQL-injection attack would have been impossible anyway (only the owner would have ever had the ability to do that), using PostgreSQL's format() is more reliable for unusual identifiers. Performance-wise, I'm not sure whether this is an improvement, but I highly doubt that it's worse.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Reformat
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Fix PostgresDriver.delete_all_data()
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Clean up PL/pgSQL code
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* More PL/pgSQL cleanup
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* PL/pgSQL function optimisations
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Ensure compatibility with PostgreSQL 10 and below
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* More/better docstrings for PG functions
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Fix typo in docstring
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Return correct value on toggle()
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Use composite type for PG function parameters
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Fix JSON driver's Config.clear_all()
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Correct description for Mongo tox recipe
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Fix linting errors
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Update dep specification after merging bumpdeps
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Add towncrier entries
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Update from merge
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Mention [postgres] extra in install docs
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Support more connection options and use better defaults
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Actually pass PG env vars in tox
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Replace event trigger with manual DELETE queries
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* [Core] Fix user output on cog load/reload
- Properly fixes the load/reload exception handling
- Fixes some i18n use here to not make assumptions about other
languages pluralization rules.
* Fix some typos
* Address Flame's Feedback
* It's important to save before committing ...
* formatting
* Fix some formats...
* Adds Schema versioning
- Adds Migration tool
- Adds tool to migrate to allow multiple admin and mod roles
- Supports Multiple mod and admin roles
* Ensures migration is run prior to cog load and connection to discord
* Updates to not rely on singular mod/admin role id
* Update requires logic for multiple mod/admin roles
* Add new commands for managing mod/admin roles
* Feedback
Update strings
Update docstrings
Add aliases
* Use snowflakelist
* paginate
* Change variable name
* Fix mistake
* handle settings view fix
* Fix name error
* I'm bad at Ux
* style fix
* 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>