1122 Commits

Author SHA1 Message Date
Draper
575e55cb0f Fixed crash originated in bank.set_balance (#2997)
* 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>

* Pushed the Fix for new issue introduced by #2926

Signed-off-by: guyre <27962761+drapersniper@users.noreply.github.com>

* Changelogs

Signed-off-by: guyre <27962761+drapersniper@users.noreply.github.com>

* Rename changelog to a misc

Signed-off-by: guyre <27962761+drapersniper@users.noreply.github.com>

* Address Flame's review

Signed-off-by: guyre <27962761+drapersniper@users.noreply.github.com>

* Correct an outdated reference in the docs

Signed-off-by: guyre <27962761+drapersniper@users.noreply.github.com>

* Reword docstring for the RuntimeError

Signed-off-by: guyre <27962761+drapersniper@users.noreply.github.com>
2019-09-22 02:05:27 -04:00
Michael H
ee3be8b633 Extra info (#3008)
* Extra info

* changelog
2019-09-20 16:55:46 +02:00
Flame442
7f22d27d51 Fixes the logic of MessagePredicate.greater and MessagePredicate.less (#3004)
* Fixes the logic of MessagePredicate.greater and MessagePredicate.less

* Create 3004.bugfix.rst
2019-09-18 17:15:24 -04:00
Michael H
4546ca9ba6
Clarify usage of humanize_timedelta (#3000)
- resolves #2986
2019-09-15 19:32:07 -04:00
Flame442
1e97597bc2 [Trivia] Overwatch - Remove a blank answer (#2996)
* Remove a blank answer

* Create 2996.bugfix.rst
2019-09-15 01:09:35 -04:00
DevilXD
77f1da30ea Tempban logging improvement (#2993)
* user and guild are logged now

* Added changelog entry

* Make sure Forbidden always triggers this as well
2019-09-13 18:40:54 -04:00
jack1142
682b86c193 [Permissions] Possible solution for clearing out usage of commands with <who_or_what> (#2992)
* style(permissions): clear out usage of commands with <who_or_what>

* chore(changelog): add towncrier entry

* style(permissions): fix black formatting
2019-09-09 15:29:19 -04:00
jack1142
cdb7a02cb8 [Core] Fix infinite typing for commands with cooldown (#2987)
* fix(core): cooldown error can't reinvoke command (infinite typing issue)

* chore(changelog): add towncrier entry
2019-09-07 19:25:02 -04:00
Flame442
0be3b1acd7 Fixes the strings of [p]set usebotcolor (#2974)
* Fixes the help text of `[p]set usebotcolor`

* Create 2974.bugfix.rst
2019-09-02 09:43:56 -04:00
Michael H
4f1f49d96f
[Modlog] userinfo stops breaking with high numbers of roles on a user (#2971)
* Fixes it, I guess

* changelog

* reluctant handling of what the people want here

* mypy would have prevented this one
2019-09-02 09:38:19 -04:00
Michael H
6075c5bde0
Rename bot.db as bot._config (#2967)
* 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*
2019-09-01 15:42:28 -04:00
Toby Harradine
d86cc7a854
Bump dependencies (no more SSL errors) (#2939)
Also made the Makefile work slightly nicer with other tools, e.g. IDE run configurations, by allowing the python executable to be set as an env var.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-09-01 09:29:54 +10:00
Toby Harradine
25fb389a7d [Docs] Update linux install docs, redo venv docs (#2920)
* [Docs] Update linux install docs, redo venv docs

Some of our pre-req installation docs needed updating on Windows - this adds new sections for Fedora Linux and Debian/Raspbian Buster, and also removes some unnecessary pre-requirements from other distributions. These have all been tested on fresh VPSes, installing Red both in venvs and with --user, and they all seem to work.

Also, apparently the venv docs were too scary before. These changes try to make it clear that it's easier to use than users may think.

This also includes a little note to stop users from accidentally installing Python with pyenv after installing pre-requirements on Ubuntu.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Add changelog entries

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Update officially supported platforms in README.md

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Combine sections and add openSUSE

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Include example of using `--user` flag

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Use `py -3.7` on Windows outside of venv

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Reorganise changelog entries

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-08-30 18:08:26 -04:00
Flame442
d9e774f079 [Docs] Typo fix (#2953)
* Fixed a typo

* Create 2953.misc.rst
2019-08-30 17:41:40 -04:00
Draper
7959e0c916 [Bank] Allow Bot Owner/Guild Owners to remove invalid users from the bank (#2845)
* 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>
2019-08-30 17:35:25 -04:00
DJtheRedstoner
ef3ac77bd8 Fix issues with embed_requested() (#2966)
* Fix issues with embed_requested()

* Update embed_requested()

Make embed_requested()'s user settings only affect DM's

* Towncrier for #2966
2019-08-30 17:20:34 -04:00
Flame442
efcf91e934 Catch discord.errors.Forbidden when DMing a user the invite message (#2948)
* 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
2019-08-29 21:19:19 -04:00
aikaterna
b8a7a66566 [Core] Inviteset public and perms help cleanup (#2963)
* [Core] Inviteset public and perms help cleanup

* Towncrier entry
2019-08-29 21:18:43 -04:00
Draper
e04eed4a89 [Bank] Allow bank managers to set the maximum allowed balance in the bank (#2926)
* 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>
2019-08-29 21:05:31 -04:00
jack1142
b490942bcd [Core] Various fixes to redbot-setup delete (#2958)
- ``redbot-setup delete`` no longer errors about "unexpected keyword argument" (fix #2955)
- ``redbot-setup delete`` no longer prompts about backup when user passes ``--no-prompt`` option (fix #2956)
- ``--[no-]backup``, ``--[no-]drop-db`` and ``--[no-]remove-datapath`` in ``redbot-setup delete`` command are now on/off flags. ``--no-prompt`` was changed to flag too, but it doesn't have ``--prompt`` equivalent as there's no much point in having it
- ``redbot-setup`` now uses `click.confirm` for confirmation prompts and thy now also have default values for user convenience
2019-08-30 08:23:31 +10:00
jack1142
26cc85806e [Utils] Stop using : in backup's filename - Windows doesn't accept it (#2957) 2019-08-28 12:01:02 +10:00
Michael H
2c8152606c [Modlog] Reduce potential for bad API calls (#2945)
- brings a fix over from #2934
2019-08-28 08:45:56 +10:00
Draper
3c1b6ae4cf [Utils] Add humanize_number() function to chat formatting (#2836)
This adds babel as a dependency, and also includes `redbot.core.i18n.get_babel_locale()`
2019-08-28 08:44:52 +10:00
ZeLarpMaster
6c3a3fea66 Fixing typo in starwars trivia (#2903)
* Fixing typo in starwars trivia

Been pointed out to us by kDals#5653

* Add a changelog entry
2019-08-27 12:44:07 -04:00
jack1142
fb9fec282b [Mod] Fix recording username changes (#2919)
* fix(mod): past names are now properly recorded in `on_user_update` event

* chore(changelog): add towncrier entry

* chore(changelog): specify what commands were affected
2019-08-27 12:42:56 -04:00
Michael H
bbd30411fd
Fixed small docstring inconsistency (#2924)
* Fixed docs inconsistency

* Added changelog entry

* Changed category from bugfix to misc
2019-08-27 12:40:36 -04:00
Draper
2056f9f8d0 [Bank] Check recipient balance before completing transfer (#2925)
* 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>
2019-08-27 12:40:11 -04:00
Michael H
68018c924e
[Economy] House always wins in slots (#2875)
* [Economy] House always wins in slots

 - Expected payout is negative
 - No flat increase payouts, all payouts are multiplicative

* actually do math properly

* UX + Changelog

* How the hell did I mess that up?!
2019-08-27 12:38:56 -04:00
DiscordLiz
0c773134f2 [Mod] Fix modset deletedelay (#2943)
* [Mod] Fix modset deletedelay

  fixes #2942

* Style guide fix
2019-08-27 09:27:24 -04:00
DevilXD
0d16e27070 Changed category from bugfix to misc 2019-08-27 10:34:44 +02:00
Toby Harradine
326c53d6c4
Quick fix for postgres config details prompt (#2951)
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-08-27 14:25:05 +10:00
Toby Harradine
d1a46acc9a PostgreSQL driver, tests against DB backends, and general drivers cleanup (#2723)
* 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>
2019-08-26 22:02:26 -04:00
Flame442
57fa29dd64 Rename two changelog files from fix to bugfix (#2949) 2019-08-27 11:42:31 +10:00
Michael H
bfa55922cf Add note for using towncrier with standalone PRs (#2915) 2019-08-27 11:39:51 +10:00
El Laggron
43da727a9f [Utils] Text to file (#2849) 2019-08-26 10:13:21 +10:00
jack1142
580c4429e8 Add pip-wheel-metadata folder to .gitignore (#2941) 2019-08-20 10:37:23 +10:00
PredaaA
3498f8ccb6 Remove commas for explanations about how to set API keys (#2905)
This removes commas in explanations about how to set API keys in streams, image and audio cogs, since it has been changed in #2692.
2019-08-18 09:50:48 +10:00
Aurorum
5e9b3d9190 [Trivia] Michael Jackson & Prince Lyrics (#2894)
I thought it'd be fun to offer lyrics as a trivia, but it can be tricky selecting songs which are known widely enough that a significant number of people have a reasonable chance of answering the questions correctly.

As such, to narrow down the scope, these add trivia questions for Michael Jackson and Prince, two of the most well-known artists across the world whose musical collections are extensive and popular enough to dedicate an entire trivia too.

They're comprised of a variety of lyrics, two lyrics for each song. Players need to name the song from the lyric. Most of the songs are well-known songs from the artist, but there are plenty of challenges too.
2019-08-18 09:31:32 +10:00
Flame442
dfb4212d43 [Docs] Fix user parameter to predicates being typed as discord.TextChannel (#2914) 2019-08-18 09:05:22 +10:00
Ianardo DiCaprio
b1ccfab6d2 [Mod] BugFix (#2932)
* Initial Commit

* Add files via upload
2019-08-13 14:33:03 -04:00
Michael H
984a97d958
[Core Commands] remove set owner and set token (#2928)
* remove set-owner and set token

* whoops, wrong number on the changelog

* whoops, git didnt detect the rename cause I didnt add the file
2019-08-13 13:57:16 -04:00
DevilXD
463546f102
Added changelog entry 2019-08-08 17:12:58 +02:00
DevilXD
477a17d0b9
Fixed docs inconsistency 2019-08-08 17:06:11 +02:00
Draper
556af32bb5 Stop saving JSON files with indents (#2921)
Stop saving json files with 4 indents, this will significantly reduce file size and improve `.set()` performance for config saves when using the JSON driver.

Signed-off-by: Draper <guyreis96@gmail.com>
2019-08-07 10:13:31 +10:00
Toby Harradine
ef8b9b81c3 [ModLog] Optimise get_next_case_number() (#2908)
* [ModLog] Optimise get_next_case_number()

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Address reviews

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Add changelog entry

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Delete get_next_case_number

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Add modlog.get_latest_case() and fix `[p]reason`

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-08-02 10:49:22 -04:00
Toby Harradine
9362dd9465
Merge V3/release/3.1.5 into V3/develop 2019-07-31 09:43:35 +10:00
Toby Harradine
6c9c57c14d Bump version to 3.1.5
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
3.1.5
2019-07-31 09:23:18 +10:00
Toby Harradine
404c5f6dc0 [Audio] Bump Lavalink version to 3.2.1_823
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-07-31 09:22:16 +10:00
DiscordLiz
20091cc10a [ModLog API] Add default casetypes, remove need for a specific auditlog action (#2901)
* 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
2019-07-27 15:37:29 -04:00
Michael H
6280fd9c28
disabled help hideaways (#2892)
* disabled help hideaways

* can_see fix
2019-07-27 02:36:21 -04:00