From 3a45a585b0b48fa748e8b579d8c36967697f1a91 Mon Sep 17 00:00:00 2001 From: Irdumb Date: Tue, 14 Jun 2016 11:26:17 +1000 Subject: [PATCH] !set stream couldn't be bothered figuring how to PR to anomaly's PR --- cogs/owner.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/cogs/owner.py b/cogs/owner.py index ac7c088d2..10497539d 100644 --- a/cogs/owner.py +++ b/cogs/owner.py @@ -275,6 +275,27 @@ class Owner: log.debug('status cleared by owner') await self.bot.say("Done.") + @_set.command(pass_context=True) + @checks.is_owner() + async def stream(self, ctx, stream_name=None, *, status=None): + """Sets Red's streaming status + + Leaving both stream and status empty will clear it.""" + + if status: + status = status.strip() + if "twitch.tv/" not in stream: + stream = "https://www.twitch.tv/" + stream + await self.bot.change_status(discord.Game(type=1, url=stream, name=status)) + log.debug('Owner has set streaming status and url to "{}" and {}'.format(status, stream)) + elif stream is not None: + await send_cmd_help(ctx) + return + else: + await self.bot.change_status(None) + log.debug('status cleared by owner') + await self.bot.say("Done.") + @_set.command() @checks.is_owner() async def avatar(self, url): @@ -554,4 +575,4 @@ def check_files(): def setup(bot): check_files() n = Owner(bot) - bot.add_cog(n) \ No newline at end of file + bot.add_cog(n)