53 Commits

Author SHA1 Message Date
Michael H
16443c8cc0 [CI] Improve automated checks (#2702)
* 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
2019-06-02 19:42:57 +02:00
Ryan
e956e6e320 [Streams] Ignore lack of rerun info where not available (#2748) 2019-05-31 16:41:23 -04:00
Flame442
6928e2aca2 Fixes some issues with API help commands (#2729)
* Fixes some issues with `[p]streamset youtubekey/twitchtoken`

Lots of general formatting bugs and clarity issues.

* General formatting bugs and clarity issues
2019-05-24 17:52:43 -04:00
Michael H
cdea03792d [Streams] Fix NameError (#2699)
- fixes #2696
 - My fault for just looking at the github diff and seeing the logic fix
 on this one, without verifying the name validity in surrounding
 context. (see my review in #2679)
2019-05-18 00:59:26 -08:00
palmtree5
21a253103e [V3 Streams] fix an issue with stream commands not dealing with reruns (#2679) 2019-05-16 22:28:26 -04:00
Tyler Adam
f28d6dff32 [Streams] Add ability to exclude rerun streams from alerts (#2620)
* [Streams] Add ability to exclude rerun streams from alerts

* [Docs] Changelog entries for contributions by EgonSpengler

* Changelog entry for #2620 [Streams] Ignore Reruns In Alerts
2019-04-25 11:58:58 -04:00
Michael H
ad114295e7
Discord.py dep update 3.1 (#2587)
* 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
2019-04-23 21:40:38 -04:00
Tyler Adam
a1b03be27e Add support for custom stream alert messages per guild (#2600) 2019-04-23 02:57:46 -08:00
TrustyJAID
eaeaf9dd69 [V3 Streams] Change twitch and youtube top level commands (#2479) 2019-04-22 20:06:50 -04:00
Toby Harradine
628073cbe1
Update Translations (#2486)
Also included a Makefile recipe which makes use of the Crowdin CLI's `crowdin download` command. This requires whoever is using it to provide the project's API key in an environment variable, but we may automate this at some point.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-03-04 08:55:01 +11:00
palmtree5
77a0a67029 [Streams] Remove communities support (#2223)
See [this blog post](https://blog.twitch.tv/introducing-tags-and-new-categories-33744ef7b04f), communities on Twitch have been discontinued.
2019-02-21 17:37:28 +11:00
TrustyJAID
3f1d416526 Allow central storage of API keys (#2389)
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.
2019-02-19 10:22:44 +11:00
palmtree5
7546c50226 [Streams] Toggle mentions on for roles being alerted (#2252)
Resolves #1831.
2018-11-24 10:46:38 +11:00
odinair
d17c2430d7 [Streams] Fix alerts with no configured mentions (#2305) 2018-11-24 10:14:43 +11:00
aikaterna
7f3a0b8a88 [Streams] Add help for streamset (#2287) 2018-11-06 10:26:55 +11:00
Toby Harradine
5ba95090d9
[Streams] Suppress HTTPExceptions on load (#2228)
Resolves #2227.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-10-15 22:31:14 +11:00
Toby Harradine
443f2ca556 [i18n] Pass over modlog, permissions, reports, streams, trivia, warnings
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-10-06 09:01:04 +10:00
Toby Harradine
0870403299
Permissions redesign (#2149)
API changes:
- Cogs must now inherit from `commands.Cog` (see #2151 for discussion and more details)
- All functions which are not decorators in the `redbot.core.checks` module are now deprecated in favour of their counterparts in `redbot.core.utils.mod`. This is to make this module more consistent and end the confusing naming convention.
- `redbot.core.checks.check_overrides` function is now gone, overrideable checks can now be created with the `@commands.permissions_check` decorator
- Command, Group, Cog and Context have some new attributes and methods, but they are for internal use so shouldn't concern cog creators (unless they're making a permissions cog!).
- `__permissions_check_before` and `__permissions_check_after` have been replaced:  A cog method named `__permissions_hook` will be evaluated as permissions hooks in the same way `__permissions_check_before` previously was. Permissions hooks can also be added/removed/verified through the new `*_permissions_hook()` methods on the bot object, and they will be verified even when permissions is unloaded.
- New utility method `redbot.core.utils.chat_formatting.humanize_list`
- New dependency [`schema`](https://github.com/keleshev/schema)

User-facing changes:
- When a `@bot_has_permissions` check fails, the bot will respond saying what permissions were actually missing.
- All YAML-related `[p]permissions` subcommands now reside under the `[p]permissions acl` sub-group (tbh I still think the whole cog has too many top-level commands)
- The YAML schema for these commands has been changed
- A rule cannot be set as allow and deny at the same time (previously this would just default to allow)

Documentation:
- New documentation for `redbot.core.commands.requires` and `redbot.core.checks` modules
- Renewed documentation for the permissions cog
- `sphinx.ext.doctest` is now enabled

Note: standard discord.py checks will still behave exactly the same way, in fact they are checked before `Requires` is looked at, so they are not overrideable. 

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-10-01 13:19:25 +10:00
Toby Harradine
df922a0e3e
[Audio] More robust startup and unload (#2118)
* More robust cleanup for audio and streams

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

* Remove copied code from streams

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-09-22 15:04:46 +10:00
palmtree5
589041556e [Streams] Fix excessive writes to config (#2095)
Resolves #2052.
2018-09-04 11:01:48 +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
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
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
Toby Harradine
dc9a85ca98
[Streams] Add docstring for [p]streamalert list (#2001) 2018-08-12 12:09:38 +10:00
Toby Harradine
51a54863c5
[Streams] Don't raise KeyError on missing token (#1994)
Some streaming services don't require a token/clientID.

Resolves #1932
2018-08-10 15:07:30 +10:00
Eslyium
cd6af7f185 [V3 Streams] Rewording Responses/Docstrings (#1837)
* [V3 Streams] Rewording Responses/Docstrings

w/ Black if I did this right

* Readding strings
2018-07-12 03:07:15 +02:00
Michael H
1c2196f78f autohelp changes. (#1836) 2018-07-12 01:23:18 +02:00
Tobotimus
a070dffb93
[V3 Streams] Fix streams race condition (#1834) 2018-06-10 00:12:58 +10:00
Michael H
17c7dd658d [V3 Core] Command group automatic help (#1790)
* decorator inheritence

* black format

* add autohelp

* modify commands to use autohelp
2018-06-08 20:54:36 -04:00
Eslyium
60a72b2ba4 [V3] Cleanup quotes in cogs (#1782)
* 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
2018-06-07 00:42:59 -04:00
jjay12365
f830f73ae6 [V3 Streams] Fixed issue with making YT Stream Embed (#1812)
fixed error not allowing bot to make yt stream embed
2018-06-06 14:57:25 -04:00
Redjumpman
1fd5dffdc7 [V3/Misc] Spelling, Grammar, and doc string fixes. (#1747)
* Update streams.py

* Update filter.py

* Update permissions.py

* Update customcom.py

* Update image.py

* Update trivia.py

* Update warnings.py
2018-06-01 19:20:12 +10:00
Tobotimus
14cc701b25 [V3] Update black version and reformat (#1745)
* Update black version and reformat

* Pin black in extras_require
2018-05-29 18:37:00 -08:00
Michael H
d3f406a34a [V3 Travis] Update travis to not skip pipfile lock... (#1678)
* Update travis to not sip pipfile lock

update pipfile dependencies

additional black formatting pass to conform to black 18.5b

* .

* pin async timeout until further discussion of 3.5 support

* .
2018-05-18 17:48:22 -08:00
Michael H
b88b5a2601 [V3] Update code standards (black code format pass) (#1650)
* ran black: code formatter against `redbot/` with `-l 99`

* badge
2018-05-14 15:33:24 -04:00
palmtree5
35001107e0 [V3 Streams] cache stream alert messages across restarts (#1630)
* [V3 Streams] cache stream alert messages across restarts

* Add some stuff to debug this

* More debug stuff

* More debug stuff

* Actually save when updating a stream alert

* Remove debug stuff

Fixes #1620
2018-05-14 09:42:28 +10:00
Tobotimus
15ea5440a3 [V3 i18n] Internationalise help for commands and cogs (#1143)
* Framework for internationalised command help

* Translator for class docstring of cog

* Remove references to old context module

* Use CogManagerUI as PoC

* Replace all references to RedContext

* Rename CogI18n object to avoid confusion

* Update docs

* Update i18n docs.

* Store translators in list instead of dict

* Change commands module to package, updated refs in cogs

* Updated docs and more references in cogs

* Resolve syntax error

* Update from merge
2018-05-12 01:47:49 +02:00
palmtree5
efdf69552f
[V3] Beta 12 release (#1525)
* [V3] update translations from Crowdin

* [V3] bump version to 3.0.0b12
2018-04-16 19:05:21 -08:00
palmtree5
d60fc06379 [V3] Update translations from Crowdin (#1490) 2018-04-02 19:39:07 -04:00
palmtree5
27b61a2770 [V3 Streams] Fix community alerts (#1426)
* [V3 Streams] fix community alerts

* drop unneeded parentheses + delete messages when removing from cache

* move to one embed for a community

* fix adding image to embed

* Remove unneeded params

* Really helps to point to the right place

* drop the game, move channel name+link to value

* Use stream title in embeds

* Increase number of streams to grab to 100

* filter out streams with existing individual alerts in the channel

* need channel id, not stream id in filtering function

* sample from the list

* we only want to break out if the alert is a TwitchStream alert

* drop off sending the mentions if there are none
2018-03-20 19:25:23 -04:00
palmtree5
fe3d6f57af [V3 Streams] Add support for Youtube streams (#1385) 2018-03-14 19:07:14 -04:00
Will
64af7800dc [V3 Config] Adjust functionality of get_attr (#1342)
* Intermediate commit

* Add defaulting stuff to config

* Remove set_attr in favor of set_raw

* Modify get_attr

* Fix issue with clearing data
2018-02-26 11:13:01 -09:00
palmtree5
0593bb9c53 [V3 i18n] Update translations from Crowdin (#1350) 2018-02-25 21:57:14 -05:00
palmtree5
86b5932c8f [V3] add a script for regenerating all strings (#1318)
* [V3] add a script for regenerating all strings

* Edits to the yml files

* Fix up deploy section

* Make generate_strings upload to Crowdin
2018-02-19 03:02:22 +01:00
Michael H
f1a20e1677 [V3 Streams] Duplicate stream alerts fix (#1244)
case insensitive on twitch streams, with a fast dedupe on load toany prior bad entries.
2018-01-14 19:17:57 -09:00
Tobotimus
68800d28fc [V3 Streams] Replace instances of ClientSession assignment with async context manager (#1238) 2018-01-14 18:43:06 -09:00
Tobotimus
d83f14d1b6
[V3 Streams] Fix preceding comma in streamalert messages (#1224)
* Refactor getting mentions for streamalerts

* Add missing await

Fixes #1192
2018-01-01 18:24:36 +11:00
Tobotimus
76ae62cb84 [V3 Streams] Improve command responses and help, rename modules (#1194)
* Command response improvements for streams

Fix #1182

Fix #1183

Various other command response improvements

* Rename main to streams, streams to streamtypes

* Raise errors for communities
2017-12-17 18:56:17 -09:00
Vicente Rivera
ee0d1d269c [V3 Streams] Fix race issue on init (#1135)
* Fix for #1132

Fixes `self.streams` being a `Task` object instead of a list. 
Also replicated for `self.communities`, since the issue is the same 
(although untested, it can be inferred).

* Implement sub-method to avoid init errors

The new method waits for `streams` and `communities` to be initialized
before running the `_stream_alerts` method, avoiding possible errors
due to lists being uninitialized

* Fix streams and communities loading

* Delete IDE config file
2017-12-09 18:58:01 -05:00
palmtree5
52f264dae6
[V3 Streams] Update picarto stream thumbnail URIs for new load-balanced thumbnails (#1130) 2017-12-03 22:04:42 -09:00