* [Commands Module] Better Typehint Support
We now do a lot more with type hints
- No more rexporting d.py commands submodules
- New type aliases for GuildContext & DMContext
- More things are typehinted
Note: Some things are still not typed, others are still incorrectly
typed, This is progress.
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* update for d.py 1.3
* Update redbot/core/commands/commands.py
Co-Authored-By: Danny <Rapptz@users.noreply.github.com>
* a few more places we use owner info
* add the cli flag + handling
* set fix
* Handle MaxConcurrencyReached.
* Bump `aiohttp-json-rpc`
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
Co-authored-by: Kowlin <Kowlin@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
- However, we are not changing the signature
- This was previously special cased for reasons related to the older
version of the help formatter we used and never re-evaluated for need.
- We should leave the signature as is both for lack of breaking, and
for potential future changes
// actually this was already done once in GH-2966 but got accidentally overwritten
* 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
* Okay, so there's a lot in this diff
* fix docstrings
* meh
* fix misleading var name
* meh...
* useful typehints
* Apply suggestions from code review
Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>
* dep warn in locations suitable
* Fix this...
* Apply suggestions from code review
Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Be quieter in expected cases
* lets put this in the log file
* inline description use because setuptools entrypoint scripts are dumb
* Another setuptools entrypoint related issue
* maybe don't crash the bot on tasks
* improve the handling a bit more + document some of the lower level bits from the perspective of 'why?'
* Adding myself to codeowners on this one
* Let's not clobber our exit code
* And, there we go
* finish that thought
* right, I bumped the python version for (part of) this
* Update redbot/__main__.py
Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>
* Okay, we should be good now
* correct exit code enum use
* cosmetic
* minor fix for linux and ctrl+c
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* feat(downloader): add `[p]cog reinstallreqs` command
* enhance: clear lib folder on minor Python version change
* chore(changelog): add towncrier entries
* enhance: warn user about detected change in OS or arch
* enhance: use actual prefix instead of `[p]`
* Whoops...
Co-Authored-By: Michael H <michael@michaelhall.tech>
* enhance: wrap message sending in try except
Co-authored-by: Michael H <michael@michaelhall.tech>
* enhance: add `Red.wait_until_red_ready()` for post connection startup
* enhance: fill `bot.owner_id` in our `on_ready`
* enhance: log missing destinations in `get_owner_notification_destinations`
* chore(changelog): add towncrier entries
* chore(changelog): use past form of verb "add"
* Removes `MAX_BALANCE` from bank, user `bank.get_max_balance()` now
`[p]bankset maxbal` can be used to set the maximum bank balance
Signed-off-by: Guy <guyreis96@gmail.com>
* Initial Commit
Signed-off-by: Draper <27962761+Drapersniper@users.noreply.github.com>
* I need to make sure I keep aika on her toes.
Signed-off-by: Draper <27962761+Drapersniper@users.noreply.github.com>
* Fixes a few missing kwargs and case consistency
Signed-off-by: Draper <27962761+Drapersniper@users.noreply.github.com>
* Fixes a few missing kwargs and case consistency v2 and typos
Signed-off-by: Draper <27962761+Drapersniper@users.noreply.github.com>
* Reset cooldowns + add changelogs
Signed-off-by: Draper <27962761+Drapersniper@users.noreply.github.com>
* Add 3 extra file formats.
Signed-off-by: Draper <27962761+Drapersniper@users.noreply.github.com>
* IRDUMB - fix capitalization.
Signed-off-by: Draper <27962761+Drapersniper@users.noreply.github.com>
* Fix a silent error, and some incorrect messages.
Signed-off-by: guyre <27962761+drapersniper@users.noreply.github.com>
* Remove unnecessary emojis from queue when they are not needed
Signed-off-by: guyre <27962761+drapersniper@users.noreply.github.com>
* Remove duplicated call in `[p]playlist update`
Signed-off-by: guyre <27962761+drapersniper@users.noreply.github.com>
* Remove duplicated call in `[p]playlist update`
Signed-off-by: guyre <27962761+drapersniper@users.noreply.github.com>
* Resolve conflicts
Signed-off-by: Draper <27962761+Drapersniper@users.noreply.github.com>
* Bring all files up to date + Black
Signed-off-by: Draper <27962761+Drapersniper@users.noreply.github.com>
* Facepalm
Signed-off-by: Draper <27962761+Drapersniper@users.noreply.github.com>
* *Sigh*
Signed-off-by: Draper <27962761+Drapersniper@users.noreply.github.com>
* *Sigh* 2.0
Signed-off-by: Draper <27962761+Drapersniper@users.noreply.github.com>
* Merge branch 'V3/develop' of https://github.com/Cog-Creators/Red-DiscordBot into audio-misc-pt1
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
# Resolve Conflicts:
# redbot/cogs/audio/audio.py
# redbot/cogs/audio/utils.py
* Import missing Typecheck
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Fix Broken docstrings
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Sort Local Tracks
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* 🤦
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Reorder the sorting of local tracks,
`alphanumerical lower then alphanumerical upper`
`a comes before A, but B comes after A`
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Black formatting
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Make the local file sorting case insensitive
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Add global blacklist/whitelist + fix some issues with original server based whitelist/blacklist
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Remove the pre-commit yaml
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Nottin to see
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Further improvement to the blacklists
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Further improvement to the blacklists
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Fix the __str__ method on LocalTracks Object
* Rename LocalTracks.to_string_hidden() to LocalTracks.to_string_user() To keep it inline with the Query object
* Remove encoding pragmas + a few typo fixes
* Update some typehints + fix some typos
* Remove this duplicate call
* Black
* fix capitalization
* Address preda's review
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Remove the API from the audio cog
- Is in direct conflict with goals stated in #2804
- Features this was intended to enable can be enabled in other more
appropriate ways later on
* changelog
* Address Aika's review
* Black
* *sigh* dont use github web ui
* Fuck windows Long live linux... *sigh* no lets ensure windows users can still use local tracks
* Merge branch 'V3/develop' of https://github.com/Cog-Creators/Red-DiscordBot into refactoring
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
# Conflicts:
# redbot/cogs/audio/audio.py
* 👀 + chore
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* facepalm
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* facepalm... again y u h8 me bruh
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* fuk this fuk u tube fuck python fuck all
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* awyehfqwajefhnqeffawefqa eqewarfqaesf qwef qaf qwfr
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* fuck everything
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* oh lord saviour resus i love you just make this work
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Change logic to be no errors within last 10 seconds... this should be a valid work around discord ratelimits caused by the spam
* Remove auto deletion
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* See I did a ting
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* irdumb
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* black
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Add an is_url attribute to Query objects
* chore
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Black
* Address Aikas review
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Hyperlink Playlist names
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Make shit bold
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* why was this here
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* why was this here
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Initial commit
* Workinnng
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Improve SQL Statements + migrate from SQL Alchemy + Databases to APSW
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* apsw tested and working
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* chose
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Migrate Playlist to DB 3 TODO
1 Migrate Config to Schema 3 without playlists
and update get_playlist methods
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Revert "Migrate Playlist to DB 3 TODO 1 Migrate Config to Schema 3 without playlists and update get_playlist methods"
This reverts commit 4af33cff
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Implement schema migration
* Lets not touch the deps since #3192 is already adding them
* chore
* *sigh* Black
* Follow the existing logic and always default Playlist to guild scope
* wghqjegqf black
* Update usage of last_fetched and last_updated to be Ints... However column migration still pending
* Some bug fixes
* Update usage of last_fetched and last_updated to be Ints... However column migration still pending
* working
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* partial match
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* better partial match
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* black
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* I thought i done this before
* Delete 3195.misc.1.rst
Wrong PR
* Thanks Sinbad
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Thanks Sinbad
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Log Errors in init ...
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Update error logs.
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Create index
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* :Drapersweat:
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Chore
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Revert "Chore"
This reverts commit edcc9a9f
UGHHHH
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Allow removing tracks from queue by URL
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Words matter
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* *sigh*
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* chore
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* arghhh CONFLICTS
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Review sinbads latest comment ..
ToDo.. Nuke existing playlist - check version and set version
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* migrate the DB schema to v3 (to keep in line with the schema visioning of Config
* Add a Todo
* *sigh* conflicts and black
* *sigh* black
* Passively delete playlist deletion mechanism
* Delete Old entries on startup
* Since we are dropping the table mightaware make these into JSON for future proofing
* Don't Dump strings in JSON field ? :think:
* Move some things around to make easier to use 1 connection to the Audio DB
* Move some things around to make easier to use 1 connection to the Audio DB
* *sigh*
* Clean up api
* *sigh* black
* Red + reorder some variables
* 🤦
* how could i forget this .......
* Black
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Black
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Black
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* #automagically
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* FINAFUCKINGLY
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* FINAFUCKINGLY
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Remove unused config default
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Remove the API from the audio Cog (Properly)
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Missed these changes
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* ARGHHH
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Some fixes I've noticed while running through the code line by line
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Translation + UX (show playlist author ID if can't find user)
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* *sigh* missed this one
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* this is no longer needed ....
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* 🤦
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* fix new lines in error messages
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Black
* Sinbads Review
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Sinbads Review
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* *sigh* copy paste
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* imrpove backups
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Im a fucking idiot
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Fix#3238
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* chore
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* humans
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* humans
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* add play alias to playlists
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Im dumb ...
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Im dumb ...
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* fix new line
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* fix new line
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* show playlist count on playlist picker
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* DJ/Vote system fixes
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* DJ/Vote system fixes
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* *sigh* fix currency check
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* show playlist count on playlist picker
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* DJ/Vote system fixes
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* DJ/Vote system fixes
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* *sigh* fix currency check
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Fix duplicate messages on timeout
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* fix SQL Statement logic
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* fix SQL Statement logic
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Markdown escape
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Markdown escape
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Markdown escape fix
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Markdown escape fix
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* clean up local cache more frequently
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* clean up db more frequently
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Await in hell
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* *sigh* im dumb
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* *sigh* im dumb
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Black cuz I hate red
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Black cuz I hate red
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* StringIO to ByteIO
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* StringIO to ByteIO
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* *sigh* im dumb
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* :Facepalm: the whole purpose of this is so its offline so this can be backed up without being blocking
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Run write queries on ThreadPoolExecutor
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Backup Audio.db
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* *sigh* im dumb
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* blaaaack
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* *sigh*
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* formatting
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* remove duplicated string of code
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* ffs awaits
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
Co-authored-by: Michael H <michael@michaelhall.tech>
* 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
* feat: dispatch `on_red_api_tokens_update` event on api keys update
* docs: add event reference in Shared API Keys docs
* chore(changelog): add tonwcrier entries
* fix: wrap dispatched api tokens in MappingProxyType
* docs: reflect change of type change to read-only Mapping
* reorder some startup to prevent heartbeat issues
* changelog
* handle startup cleanup in audio
* style
* rebased to handle conflict
* be a little smarter to prevent (some) infinite hangs
* Fix a pre-existing NoneType Error
* Migrate config before things are using it...
* another place we should ensure we're ready
* rename-toavoid-issues
* fix cache ordering and mis-use of ensure_future
* remove incorrect typehints
* style
* 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*
* 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>
* Make Requires.verify() wait until rules are loaded
Also ensures `Requires` objects are reset when unloaded, particularly in case a `Command` object manages to stay in memory between cog unload and load, and its permissions rules change between those events.
Also, this PR re-ordered some of the event loop policy stuff, because it was required that the event loop policy be set before creating any `Requires` objects. This may or may not have an effect on other `get_event_loop()` calls elsewhere (either in our code, a dependency's, or asyncio's). Either way, these effects would be a *correction*, and any bugs that arise from it are likely to have been occurring silently beforehand.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Remove calls to `remove_listener()` in permissions
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Fix adding rules for permissions cog/commands itself
Also addresses feedback
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Clean up indentation when setting uvloop policy
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Use `set(walk_commands())` to traverse `Group` subcommands
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
This still preserves the new event, which was a welcome change. However, context still needs to be invoked when a command isn't found, so `on_command_error` can still catch `commands.CommandNotFound`.
Fixes broken fuzzy help.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* 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
* Add bot.send_to_owner
resolves#2665
Adds some basic methods and config entries.
Does not add commands for modifying this yet.
* Use send_to_owners in events
* handle feedback
* [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
* [Bot] Support new design
* [Context] use the new help in `ctx.send_help`
* [Commands] Update Cog and Group for help compat
- Removes a trap with all_commands, this isn't a good way to check this
- Adds a help property
- Fixes command parsing in invoke
* Redesigns red's help
* handle fuzzy help
* style
* handle a specific ugly hidden interaction
* fix bot-wide help grouping
* changelog
* remove no longer needed -
* 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
* Do things differently
* Uncomment critical lines
* Reduce, reuse, recycle
* Check groups on all new config objects after a cog loads
* I don't know why this is failing now or why we need the global keyword
* gotta fix this too
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.
- Removed memory-sided `CogManager._paths` attribute, as it has no practical use.
- `[p]removepath` now removes the actual path displayed with the index specified in `[p]paths`.
- New method for retreiving a deduplicated list of user-defined paths as `Path` objects
- General cleanup so we don't have to do so much head-scratching next time an issue arises here
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>