* Cache prefixes
- This works towards #3148
- Ends up centralizing some logic
- Including that prefixes should be a reverse sorted list
* handle global prefix attempts at none
* fix prefix set for server
* cache using guild id
* Update core_commands.py
* Create 3115.feature.rst
* Rename 3115.feature.rst to 3118.feature.rst
* Add a message if there's any disabled commands.
* Use the same format as [p]command disable/enable
* Make strings more i18n friendly.
* Flame's requested changes.
* Add quotes to clarify helpset tagline
Add quotation marks to helpset tagline's response so two consecutive full stops don't appear.
* more commiting
* make travis/black happy
* for review
make no longer repeat tagline
* More privatization, and some error helpers
This makes a lot more things private. Continued from #2967, fixes#2984
Adds public methods for various things.
Below is a brief summary of things available elsewhere, though this
particular set of changes may warrant a detailed section in the release notes.
- bot.db.locale -> redbot.core.i18n.get_locale
- Note: This one already existed.
- bot.db.help -> redbot.core.commands.help.HelpSettings
- bot db whitelist/blaclist? -> bot.allowed_by_whitelist_blacklist
- This has also been made a single cannonical function for this
purpose including check usage
- bot color? -> bot.get_embed_color/bot.get_embed_colour
- bot.id.api_tokens? ->
- bot.get_shared_api_tokens
- bot.set_shared_api_tokens
- bot.remove_shared_api_tokens
-bot.db.prefix -> bot.get_valid_prefixes
- (Note: This is a wrapper around bot.get_prefix)
Other changes include
- removing `bot.counter` as it was never used anywhere
- Adding properties with helpful error messages for moved and renamed
things
- making bot.uptime a property with an error on set
- adding a migration to the bot config for shared_api_tokens
* Remove overly encompassing message redaction, eval is a risk, dont run in dev if you cant manage it
* address Flame's feedback
* rephrase example
* changelog extras
* You saw nothing
* 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