[Owner] Added [p]set stream command (#310)

This commit is contained in:
Irdumb 2016-09-18 12:39:27 +10:00 committed by Twentysix
parent 5f57ac29ee
commit 6c53947219

View File

@ -295,6 +295,27 @@ class Owner:
await self.bot.change_status(None)
log.debug('status cleared by owner')
await self.bot.say("Done.")
@_set.command(pass_context=True)
@checks.is_owner()
async def stream(self, ctx, streamer=None, *, stream_title=None):
"""Sets Red's streaming status
Leaving both streamer and stream_title empty will clear it."""
if stream_title:
stream_title = stream_title.strip()
if "twitch.tv/" not in streamer:
streamer = "https://www.twitch.tv/" + streamer
await self.bot.change_status(discord.Game(type=1, url=streamer, name=stream_title))
log.debug('Owner has set streaming status and url to "{}" and {}'.format(stream_title, streamer))
elif streamer is not None:
await send_cmd_help(ctx)
return
else:
await self.bot.change_status(None)
log.debug('stream cleared by owner')
await self.bot.say("Done.")
@_set.command()
@checks.is_owner()