1102 Commits

Author SHA1 Message Date
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
Toby Harradine
af096bc1cc Config locks (#2654)
* Config locks

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

* Add locks for all_XXX

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

* Remove a word

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

* Add acquire_lock kwarg for value context manager

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

* Add towncrier entry

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

* Fix issues with `get_custom_lock` and `get_members_lock`

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-07-23 16:50:07 -04:00
Michael H
a8091332b8 [Docs] Add version guarantees (#2882)
Make some version guarantees.

We also need to do a pass over the existing things this would cover and decide if any of them should be made private.
2019-07-19 11:50:33 +10:00
DevilXD
7ba50c91a2 Fixed remove_command error when trying to remove a non-existent command (#2889)
* Fixed remove_command error when trying to remove a non-existent command

* Added changelog entry
2019-07-18 05:49:40 -04:00
DevilXD
0ba9eaeccc Slowmode now accepts integer only inputs as seconds (#2884)
* Slowmode now accepts integer only inputs as seconds

* Added changelog entry
2019-07-17 08:47:37 -04:00
Michael H
d4b6fdea92 Add towncrier (#2873)
* Adds towncrier as our changelog system.
* Updates our contributor guidelines for this.

Resolves #2872
2019-07-17 11:12:43 +10:00
Toby Harradine
f0f274e1e1 Bump version to 3.1.4
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
3.1.4
2019-07-16 11:26:25 +10:00
Toby Harradine
e9f014df07
Revert "Update Crowdin configuration file" (#2878)
This reverts commit 03e59ea9.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-07-16 10:44:49 +10:00
Toby Harradine
778eadd418
[ModLog] Fix get_case() and get_casetype() (#2877)
This fixes `[p]reason` and `[p]case` with cases that were created after 3.1.3.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-07-15 20:18:21 +10:00
Toby Harradine
3de9d15410
[CustomCom] Set Requires.ready_event before invoking CC (#2876)
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-07-15 20:13:06 +10:00
Michael H
3b0567d261
bump (#2864) 3.1.3 2019-07-14 00:17:44 -04:00
Michael H
49a75b5f19 command translator quick fix (#2870)
* command translator quick fix

* command translator quick fix
2019-07-14 13:55:47 +10:00
Toby Harradine
8676dd3ce3 [i18n] Update translation catalogs (#2867)
* [i18n] Update translation catalogs

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

* Install redgettext 3.1 in travis crowdin deployment

Last time the catalog templates were updated, redgettext 3.0 was used. I'd rather Travis didn't upload them after extracting with an older version.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-07-13 23:52:18 -04:00
Toby Harradine
d5c412e3df [Permissions] Fix Requires.ready_event.set() on subcommands (#2868)
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-07-13 23:05:07 -04:00
Toby Harradine
1d2980f8fa [Permissions] Send help on missing argument (#2865)
* [Permissions] Send help on missing argument

Resolves #2851.

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

* [Permissions] Use varargs instead of Greedy converter

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-07-13 21:52:28 -04:00
jack1142
3e80edcdfd [Docs] Add awaits and missing imports in usage examples (#2860)
Well, the modlog examples had to be changed a lot, because `await` obviously won't work in regular method.
2019-07-14 11:30:10 +10:00
aikaterna
be184b57dd [Audio] Update equalizer permissions (#2813)
* [Audio] Update equalizer permissions

* Reformat header on eq list for i18n

* Style
2019-07-13 20:48:13 -04:00
Toby Harradine
f83f378528 [Core] Make Requires.verify() wait until rules are loaded (#2857)
* 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>
2019-07-13 20:47:40 -04:00
Michael H
21a6384ebf [Modlog] Fix get_case for missing cases (#2858)
Due to the modlog redesign, the detection for a missing case changed. This fixes `get_case` for this.

This resolves #2844.
2019-07-14 10:47:16 +10:00
Toby Harradine
03e0683dd7 [ModLog] Actually prevent duplicate kwarg error
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-07-13 14:39:50 +10:00
Michael H
ac2813012a
[Core] Cog load fixes (#2854)
* split out some fixes from red#2853

* address feedback

* feedback
2019-07-12 22:11:06 -04:00