mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 11:48:55 -05:00
[Owner] Added [p]set stream command (#310)
This commit is contained in:
parent
5f57ac29ee
commit
6c53947219
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user