mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 19:28:54 -05:00
[Streams] [p]streamalert twitch channel is not for Discord channels (#2048)
Resolves #2003. Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
This commit is contained in:
parent
0aca00b245
commit
f595afab18
@ -141,14 +141,20 @@ class Streams:
|
|||||||
async def streamalert(self, ctx: commands.Context):
|
async def streamalert(self, ctx: commands.Context):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@streamalert.group(name="twitch")
|
@streamalert.group(name="twitch", invoke_without_command=True)
|
||||||
async def _twitch(self, ctx: commands.Context):
|
async def _twitch(self, ctx: commands.Context, channel_name: str = None):
|
||||||
"""Twitch stream alerts"""
|
"""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")
|
@_twitch.command(name="channel")
|
||||||
async def twitch_alert_channel(self, ctx: commands.Context, channel_name: str):
|
async def twitch_alert_channel(self, ctx: commands.Context, channel_name: str):
|
||||||
"""Sets a Twitch alert notification in the channel"""
|
"""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())
|
await self.stream_alert(ctx, TwitchStream, channel_name.lower())
|
||||||
|
|
||||||
@_twitch.command(name="community")
|
@_twitch.command(name="community")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user