* Add command to remove dead members from bank
* Add a global check
* Added a FIXME so `bank_local_clean` is updated once bulk-update is implemented
Added a brief warning to warn devs not to use the `_get_base_group` as it can mess up their config files
Removed a redundant existence check
* Updated commit to reflect changes requested in review
* Updated commit to reflect changes requested in review
* 🤦
* Return command to run with user id so we don't worry about safeguarding the command agaisn't invalid formats
* Braaaainnn
Removed aliases that used old naming scheme
* TL:DR Added global bank support, and rework permissions
Renamed `bank_local_clean` to `bank_prune`
Added support for global banks to `bank_prune`
`bank_prune` will now raise `BankPruneError` if trying to prune a local bank and `guild` is not supplied
Renamed `cleanup` subgroup to `prune`
`prune` subgroup will have 3 commands:
`user` : Deletes the bank account for the specified member : Accepts `Union[discord.Member, discord.User, int]`
`global` : Prune global bank accounts for all users who no longer share a server with the bot
`local` : Prune local bank accounts for all users who are no longer in the guild
Changed check for `prune` subgroup to be `@check_global_setting_admin()`
[p]bank prune local : Can be run by Guild owners only
[p]bank prune global : Can be run by Bot Owner only
[p]bank prune user : Can be run by Admins, Guild owners and Bot Owner
* Yikes ... Updated kwarg name
* Fixed unexpected unindent: docstring of redbot.core.bank.bank_prune:14:Field list ends without a blank line
* ...
* 3rd time lucky?
* 4th time lucky?
* Fix Docstring
* Initial commit to address review by Flame
* Updated code to reflect Flame's comments
* Skip pruning of unavailable guilds
* Fixed typo in string
* *sigh* black is the bane of my existence
* addressed Flames commends
Fixed [p]bank prune user, When run via DM it will now return an error message to the user (Thanks jack1142)
* Time to get some sleep
* 'DM' > 'DMs' in string
* Add towncrier entries
Signed-off-by: Draper <guyreis96@gmail.com>
* Update to reflect Flame's review
Signed-off-by: guyre <27962761+drapersniper@users.noreply.github.com>
* 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>
* 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>
* 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>
* Rename method 🤦
Signed-off-by: Guy <guyreis96@gmail.com>
* Updated this to be aware of #2925
Signed-off-by: guyre <27962761+drapersniper@users.noreply.github.com>
* Addressed Flames review + Fixed 1 bug in errors.py + `[p]leaderboard` and `[p]bank balance` will set the users balance to max balance if the bank maxbal is lower than the previous user balance
Signed-off-by: guyre <27962761+drapersniper@users.noreply.github.com>
* Missed this clarification
Signed-off-by: guyre <27962761+drapersniper@users.noreply.github.com>
* address Flames review
Signed-off-by: guyre <27962761+drapersniper@users.noreply.github.com>
* Fixed `[p]local start`
Playlist picker auto selects if theres just 1 playlist found
`[p]queue cleanself` added
Signed-off-by: Guy <guyreis96@gmail.com>
* Black.... you are supposed to trigger before commits
Signed-off-by: Guy <guyreis96@gmail.com>
* Added `BalanceTooHigh` to the docstrings of `bank.transfer_credits()`
Signed-off-by: guyre <27962761+drapersniper@users.noreply.github.com>
* Bring this in line with #2926 to reduce conflicts,`is_global()` already is called inside `get_currency_name` and as such it does not need to be called outside
Signed-off-by: guyre <27962761+drapersniper@users.noreply.github.com>
Resolves#2091.
This doesn't fix every OverflowError with MongoDB; but at least the seemingly easiest one to achieve with core cogs.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Make calling groups useful
This makes config.Group.__call__ effectively an alias for Group.all(),
with the added bonus of becoming a context manager.
get_raw has been updated as well to reflect the new behaviour of
__call__.
* Fix unintended side-effects of new behaviour
* Add tests
* Add test for get_raw mixing in defaults
* Another cleanup for relying on old behaviour internally
* Fix bank relying on old behaviour
* Reformat
* 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
* [V3 Economy] implement suggestions from #1371
* Fix a typo
* Add functions for getting leaderboard and leaderboard position
* Use the new functions to get leaderboard position and leaderboard (overrides https://github.com/Cog-Creators/Red-DiscordBot/pull/1435)
* Actually implement showing only guild members on leaderboard when bank is global
* get_leaderboard_position needs to be awaited
* For global bank, pass None for guild to get_leaderboard when trying to find position
* Remove some unneeded code
* Wrong index...
* Combine 3 messages into 1
* Fix guild leaderboard while bank is global
* add missing parentheses
* Modify the leaderboard formatting
* More work on leaderboard formatting
* no subtraction
* Fixed equality operator
can_spend function should be using a >= instead > so that you can spend all of your currency.
* Update bank.py
Fix for withdraw using the wrong equality operator.
* Revert withdraw_credits
Reverted withdraw_credits back to original operator.
* Basic Mongo Driver
* Update docstrings
* WIP motor support
* Use motor
* Update docs, add selective importer
* Make use of selective importer
* Fix docs
* Fix config storage location for JSON
* Add delimiters in the drivers doc section
* Make async things async
* Add basic config information for mongo driver
* get info from basic setup into config
* IT WORKS
* Add dependency for RJM's PR.
* Added alternative to all_from_kind
* Returned dicts include default values
Also added docstrings
Also removed all_globals since it's kind of redundant and it wasn't working out for me
* Refactored clear_all
* Tests
* Tests again..
* Make all new methods coroutines
Ya'll are gonna hate me.
* Initial modifications
* Add initial setup.py
* working setup py help
* Modify setup file to package stuff
* Move a bunch of shit and fix imports
* Fix or skip tests
* Must add init files for find_packages to work
* Move main to scripts folder and rename
* Add shebangs
* Copy over translation files
* WORKING PIP INSTALL
* add dependency information
* Hardcoded version for now, will need to figure out a better way to do this
* OKAY ITS FINALLY FUCKING WORKING
* Add this guy
* Fix stuff
* Change readme to rst
* Remove double sentry opt in
* Oopsie
* Fix this thing
* Aaaand fix test
* Aaaand fix test
* Fix core cog importing and default cog install path
* Adjust readme
* change instance name from optional to required
* Ayyy let's do more dependency injection