From f595afab182e0ec604dd63fdaca2e3f93a4539e4 Mon Sep 17 00:00:00 2001 From: Toby Harradine Date: Sun, 26 Aug 2018 23:18:22 +1000 Subject: [PATCH] [Streams] `[p]streamalert twitch channel` is not for Discord channels (#2048) Resolves #2003. Signed-off-by: Toby Harradine --- redbot/cogs/streams/streams.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/redbot/cogs/streams/streams.py b/redbot/cogs/streams/streams.py index ec81e7a3f..d29541091 100644 --- a/redbot/cogs/streams/streams.py +++ b/redbot/cogs/streams/streams.py @@ -141,14 +141,20 @@ class Streams: async def streamalert(self, ctx: commands.Context): pass - @streamalert.group(name="twitch") - async def _twitch(self, ctx: commands.Context): + @streamalert.group(name="twitch", invoke_without_command=True) + async def _twitch(self, ctx: commands.Context, channel_name: str = None): """Twitch stream alerts""" - pass + if channel_name is not None: + await ctx.invoke(self.twitch_alert_channel, channel_name) + else: + await ctx.send_help() @_twitch.command(name="channel") async def twitch_alert_channel(self, ctx: commands.Context, channel_name: str): """Sets a Twitch alert notification in the channel""" + if re.fullmatch(r"<#\d+>", channel_name): + await ctx.send("Please supply the name of a *Twitch* channel, not a Discord channel.") + return await self.stream_alert(ctx, TwitchStream, channel_name.lower()) @_twitch.command(name="community")