722 Commits

Author SHA1 Message Date
Toby Harradine
54baf687ec
[Downloader] Parse tree URLs when cloning repos (#2119)
* [Downloader] Parse tree URLs when cloning repos

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

* Only match GitHub and GitLab URLs

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-09-12 10:03:15 +10:00
Toby Harradine
8096cd803e
Bump version to 3.0.0b21 (#2115)
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
3.0.0b21
2018-09-10 00:44:11 +10:00
Toby Harradine
27b0d606c8
Fix CCs with no args (#2114)
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-09-10 00:35:53 +10:00
aikaterna
af220e497f [Docs] Update sample cog (#2072)
* [V3 Docs] Update sample cog

* Remove self.bot assignment

We don't really do this any more unless we need to
2018-09-09 23:35:22 +10:00
Toby Harradine
892b2487f5
Dependency update (#2100)
aiohttp-json-rpc 0.11 -> 0.11.1
atomicwrites 1.1.5 -> 1.2.1
attrs 18.1.0 -> 18.2.0
certifi 2018.4.16 -> 2018.8.24
discord.py 8ccb98d395537b1c9acc187e1647dfdd07bb831b -> 00a659c6526b2445162b52eaf970adbd22c6d35d
fuzzywuzzy 0.16.0 -> 0.17.0
imagesize 1.0.0 -> 1.1.0
multidict 4.3.1 -> 4.4.0
py 1.5.4 -> 1.6.0
pytest 3.7.0 -> 3.7.4
sphinx 1.7.6 -> 1.7.8

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-09-09 23:21:48 +10:00
Kowlin
7971c02dc5 Escape user and passwords for mongo (#2111)
* Escape user and passwords for mongo.

* Quote -> Quote_Plus

* formatting
2018-09-09 23:07:40 +10:00
zephyrkul
c1d8272b49 [CustomCommands] Show parameter name correctly in help (#2102) 2018-09-09 23:05:33 +10:00
aikaterna
bce5dd26f3 [Audio] Local playback (#2097)
* [V3 Audio] Local playback

* Formatting

* Update application.yml

* Add catch for an empty localtracks directory

* Linebreak in help for i18n
2018-09-09 23:02:53 +10:00
zephyrkul
04e97f3516 [CustomCom] Custom Command Parameters (#2051)
* [V3 CustomCom] Custom Command Parameters

Allows specifying more parameters for CC's via {0}, {1}, etc. that will be filled by the user invoking the CC. Python-style type hinting and attribute access is also allowed for Discord and builtin types.

> [p]cc add simple greet Hi, {0.mention:Member}!
> ...
> [p]greet zephyrkul
> Hi, @zephyrkul!

The bot will reply with the standard help messages if the cc is incorrectly executed.

> [p]greet me
> Member "me" not found

* black formatting

* check command failure

Only call the custom command if the faked command succeeded.

* misc fixes

1) don't str.strip all the time, it's not family-friendly and doesn't match transform_parameter
2) transform_arg now actually returns strings in every case
3) improve prepare_args parsing security
4) help parameters will show what type they expect
5) make linter less angery

* customcom documentation

I hate rst

* don't require repeated type hinting

If a parameter was type hinted previously, don't require it again.
Ex: `{0.display_name:Member}#{0.discriminator}` is now possible.

* add cog_customcom.rts to index

I despise rst

* don't enforce order

Allow type hinting and attribute access to be in either order.
Ex. `{0:Member.mention}` is now valid.

* clean up on_message

We're building context anyway, may as well use it.

* [doc] correct cog name

Cog class is named CustomCommands, not CustomCom

* minor on_message optimization

only build context if it's needed

* update cc_add docstring

Old one wasn't user-friendly. Replaced with a link to the new docs.
Link will not function until PR is merged and docs refreshed.

* [doc] change repeat to say

repeat is an audio command, use say in the example instead

* compare ctx.prefix to None

allows for null prefixes, which is a bad idea but who am I to judge

* address review

* raise error on conflicting colon notation

bugfix I was working on but failed to actually commit
2018-09-07 00:14:02 +10:00
Toby Harradine
7eed033c9e
Prettify README and translate to MarkDown (#2101)
Signed-off-by: Redjumpman <redjumpman@users.noreply.github.com>
2018-09-06 21:53:18 +10:00
Richard Guan
a2fe1a8757 [Audio] Don't allow duplicate links in playlists (#2071)
* Just a test

* another test

* undoing my test

* First solution, style issue

* Works functionally, but there are is a minor style issue

* style fixed

* Revert README changes
2018-09-06 16:25:27 +10:00
Toby Harradine
9ee860c3f0
[Core] Command disable feature (#2099)
* [Core] Command disable feature

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

* [Core] Allow user to set the "command disabled" message

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

* Reformat

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-09-06 12:52:19 +10:00
Toby Harradine
1dbe9537e9
Ignore fuzzywuzzy slow sequence matcher warning (#2096)
* Ignore fuzzywuzzy slow sequence matcher warning

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

* Add log.info call instead

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-09-06 12:50:30 +10:00
Toby Harradine
775f4ce69a
Use ProactorEventLoop on Windows (#2062)
* Use ProactorEventLoop on Windows

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

* Set the actual loop instead of the policy

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-09-06 00:40:15 +10:00
zephyrkul
e83beeef34 [Audio] Add [p]sing (#2067)
* port [p]sing

* [p]sing in alphabetical order

what even is an alphabet
2018-09-04 13:23:50 +10:00
Brramble
e77cfff892 [p]serverinfo respects set embed colour (#2083) 2018-09-04 13:01:50 +10:00
Michael H
9495432b8f More mention filtering (#2081)
* more filters

* note to future people touching this

* chan mentions were almost missed...

* Swap strategies as the previous escaped the mention, while still pinging the user/role
2018-09-04 12:59:59 +10:00
palmtree5
d71c334a34 [Filter] Fix issue with filtering sentences (#2065) 2018-09-04 12:55:18 +10:00
Michael H
aa8cc90ad0 Update minimum Python version to 3.6.2 (#2093)
* Correct minimum version

see #2092 

While this is needed because of an import just for typing, I see no reason not to bump the minimum version since this is a minor version difference since this is several minor version behind the latest 3.6, and there have been both security and performance improvements since.

That said, we need to be testing on our lowest supported version to ensure we don't have this happen again, right now our tests run on whatever Travis grabs for 3.6, which I assume is 3.6.6, but could be wrong.

* Update other mentions of min version to 3.6.2
2018-09-04 11:38:56 +10:00
palmtree5
589041556e [Streams] Fix excessive writes to config (#2095)
Resolves #2052.
2018-09-04 11:01:48 +10:00
El Laggron
85354f2722 Support missing .po files (#2068)
* [V3 Core] Support missing .po files

* Modified if-state

* Use PEP8 recommendation for empty list check

https://www.python.org/dev/peps/pep-0008/#programming-recommendations
2018-09-03 15:44:58 +10:00
Toby Harradine
c0c5535005
[Warnings] Help users understand custom reasons (#2049)
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-09-03 14:57:14 +10:00
zephyrkul
e126cf9f4e [Launcher] use "python -m" to run Red (#2080)
friendlier for virtual environments
2018-09-03 10:44:50 +10:00
aikaterna
c2d23b37a7 [Audio] Fix for using [p]now with thumbnail (#2063) 2018-08-28 13:02:40 +10:00
aikaterna
3a968d707f Fix Travis deployment attempt 2 (#2061) 3.0.0b20 2018-08-27 10:24:03 +10:00
aikaterna
b07c44c8b4 Fix travis deployment (#2060) 2018-08-27 10:09:02 +10:00
aikaterna
43b0a58649 [Audio] Fix for embed color (no, COLOUR) on notify messages (#2059) 2018-08-27 09:44:19 +10:00
Toby Harradine
f258e93cf7
Bump version to 3.0.0b20 (#2050)
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-08-27 09:28:37 +10:00
Toby Harradine
93138b04cb
[Streams] Set YouTube channel name when added by ID (#2047)
* [Streams] Set YouTube channel name when added by ID

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

* Move unset token raise to correct place

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

* Correct logic in get_stream

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

* Fetch name explicitly instead

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-08-26 23:53:47 +10:00
Toby Harradine
0cf54ec9c2
[Audio] Do less strict matching for java version (#2035)
* [Audio] Do less strict matching for java version

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

* [Audio] Fix java version bounds to account for Oracle's bullshit

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-08-26 23:49:27 +10:00
Toby Harradine
ce031cf7bd
[Docs] Add virtualenv guide and compress install guides (#2029)
* [Docs] Add virtualenv guide and compress install guides

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

* [Docs] Better cross-referencing

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

* Fix pyenv-installer link

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

* Use sudo -e instead of sudo nano

* Add note about launcher for linux/mac

* Include launcher notes in Windows guide

* Add missing colon
2018-08-26 23:44:56 +10:00
Toby Harradine
e6495bc7c0
[Trivia] Move Trivia lists back home (#2028)
* [Trivia] Move trivia lists back home

Removes red-trivia as a dependency.

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

* Include package data in distribution

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

* Add test from red-trivia repo, and fix package data setup

* The distribution will now include all files under any data/ sub-directory of a package, as well as all *.po files under any locales/ sub-directory (as it should have been before).

* MANIFEST.in has been simplified to comply with these changes and redbot/cogs/audio/application.yml has been moved to the data/ sub-directory to maintain consistency in how we declare package data.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-08-26 23:39:46 +10:00
Toby Harradine
1b196bf0fb
[i18n] Use redgettext over pygettext (#2023)
* [i18n] Use redgettext over pygettext

* Clear out autogenerated `messages.pot` files

* Remove redundant `regen_messages.py` files

* Refactor `generate_strings.py` to use redgettext

* Install redgettext in Travis Crowdin job

* Clean up some problematic usages of gettext function

* Reformat

* Replace generate_strings.py with Makefile argument

* Update to redgettext 2.1, use exclusion pattern

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-08-26 23:35:42 +10:00
Toby Harradine
dbed24aaca
[Config] Group.__call__() has same behaviour as Group.all() (#2018)
* 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
2018-08-26 23:30:36 +10:00
Toby Harradine
48a7a21aca
[Commands] Refactor command and group decorators (#1818)
* [V3 Commands] Refactor command and group decorators

* Add some tests

* Fix docs reference

* Tweak Group's MRO
2018-08-26 23:25:25 +10:00
Toby Harradine
f595afab18
[Streams] [p]streamalert twitch channel is not for Discord channels (#2048)
Resolves #2003.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-08-26 23:18:22 +10:00
Brramble
0aca00b245 [Audio] Embed colours respect user settings (#2046)
* Embed colours now respect what the user set

* Formatting

* Get embed colour when ctx is unavailable
2018-08-26 13:09:03 +10:00
Toby Harradine
9af58d3abf
[Permissions] Remove hook from is_owner check (#2053)
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-08-25 21:56:40 +10:00
aikaterna
dd5ef3696f [Audio] Add thumbnail display with toggle (#1998)
* [V3 Audio] Add thumbnail display with toggle

* [V3 Audio] Add thumbnail to notify messages

* Formatting

* Update thumbnail fetching

* Update thumbnail fetching

* Track thumbnail moved to Red-Lavalink

* Formatting
2018-08-25 10:47:20 +10:00
Toby Harradine
03d49bac53 Update Red-Lavalink to version 0.1.2 (#2034)
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-08-24 16:28:01 +02:00
Toby Harradine
6c082a10b1 Fix sync check causing errors (#2045)
* Fix sync check causing errors

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

* Import timedelta...

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-08-24 16:23:52 +02:00
Michael H
77944e195a Output sanitisation (#1942)
* Add output sanitization defaults to context.send
Add some common regex filters in redbot.core.utils.common_filters
Add a wrapper for ease of use in bot.send_filtered
Sanitize ModLog Case's user field (other's considered trusted as moderator input)
Sanitize Usernames/Nicks in userinfo command.
Santize Usernames in closing of tunnels.

* Add documentation
2018-08-24 23:50:38 +10:00
Michael H
6ebfdef025 Remove self-bot support (#2008) 2018-08-24 22:51:03 +10:00
El Laggron
bc39a6741c [Launcher] append --user if the bot isn't in a venv (#2027)
* [V3 Launcher] --user CLI flag

* Better handling of the sys arguments

* Black reformat to -l 99

* Update launcher to PR#2025

* Always append --user if not in a virtualenv

* Remove --user flag
2018-08-24 22:33:57 +10:00
Michael H
bda7e08208 Handle time innacuracy by warning owner (#2036)
* handle time innacuracy by warning owner

* Fix typo and add space
2018-08-23 11:28:05 +10:00
Michael H
aa69dd381f [Core] Use autohelp properly in local blacklist/whitelist (#2042) 2018-08-23 11:22:03 +10:00
Michael H
1fd8a8e0a6 [Cleanup] Refactor internals (#2013)
* Revert "[Cleanup] Hotfix for [p]cleanup after (#2004)"

This reverts commit 7959654dc80c68c46e9c965320322f0d6bfde446.

* refactor cleanup

* formatting pass

* put back in try/except block
2018-08-21 12:31:48 +10:00
Caleb Johnson
1329fa1b09 [CogManager, Utils] Handle missing cogs correctly, add some helpful algorithms (#1989)
* Handle missing cogs correctly, add some helpful algorithms

For cog loading, only show "cog not found" if the module in question was the one
that failed to import. ImportErrors within cogs will show an error as they should.

- deduplicator, benchmarked to be the fastest
- bounded gather and bounded async as_completed
- tests for all additions

* Requested changes + wrap as_completed instead

So I went source diving and realized as_completed works the way I want it to,
and I don't need to reinvent the wheel for cancelling tasks that remain
if the generator is `break`ed out of. So there's that.
2018-08-21 11:26:04 +10:00
Michael H
b550f38eed [Reports] Add guild-only command check (#2016)
Resolves #2015
2018-08-17 00:00:24 +10:00
Toby Harradine
ae7b912ac8
Major dependency update (#1974)
* [V3] Stop `tmp` dir showing up

* [V3] Remove requirements.txt and declare in install_requires

* Remove requirements.txt from tox.ini

* Update and pin all dependencies and sub-dependencies

* Update for breaking changes

* Reformat

* Update docs/requirements.txt and tox.ini requirements

* Add 3.7 to identifiers and travis/tox builds

* Attempt at fixing the travis build matrix

* Attempt #2

* Attempt 3

* aiohttp.ClientSession.close() -> detach() in sync code

* Add raven-aiohttp to requirements

* Fix stuff in setup.py

 - Added discord.py back into requirements list
 - Fix typo in alabaster extra requirement

Also in the Pipfile:
 - Removed allow_prereleases and explicitly pinned black, since this is the only dep we want a prerelease for.

* Update to Rapptz/discord.py@8ccb98d395

* Add proper 3.7 build in Travis

See travis-ci/travis-ci#9815

* Which version of 3.6 does Xenial install then?

* Maybe we should stop pipenv installing useless stuff

* Nevermind, back to specific minor version

* Remove lots of WET dependency stuff

* Fix egg fragment for dependency link
2018-08-15 12:10:55 +10:00