mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 19:58:54 -05:00
[Owner] Added [p]set stream command (#310)
This commit is contained in:
parent
5f57ac29ee
commit
6c53947219
@ -296,6 +296,27 @@ class Owner:
|
|||||||
log.debug('status cleared by owner')
|
log.debug('status cleared by owner')
|
||||||
await self.bot.say("Done.")
|
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()
|
@_set.command()
|
||||||
@checks.is_owner()
|
@checks.is_owner()
|
||||||
async def avatar(self, url):
|
async def avatar(self, url):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user