mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 03:38:53 -05:00
[V3 Core Commands] Limit status modifying commands to be run in guild only (#1331)
* Limit status modifying commands to be run in guild only * JK let em run. * Add a space
This commit is contained in:
parent
de4af14676
commit
93ca7abc1a
@ -375,10 +375,14 @@ class Core:
|
||||
|
||||
@_set.command(name="game")
|
||||
@checks.is_owner()
|
||||
@commands.guild_only()
|
||||
async def _game(self, ctx, *, game: str=None):
|
||||
"""Sets Red's playing status"""
|
||||
status = ctx.me.status
|
||||
"""Sets Red's playing status
|
||||
|
||||
Can only be run if the bot is in a server."""
|
||||
if len(ctx.bot.guilds) == 0:
|
||||
await ctx.send_help()
|
||||
return
|
||||
status = ctx.bot.guilds[0].me.status
|
||||
if game:
|
||||
game = discord.Game(name=game)
|
||||
else:
|
||||
@ -389,8 +393,13 @@ class Core:
|
||||
@_set.command(name="listening")
|
||||
@checks.is_owner()
|
||||
async def _listening(self, ctx, *, listening: str=None):
|
||||
"""Sets Red's listening status"""
|
||||
status = ctx.me.status
|
||||
"""Sets Red's listening status
|
||||
|
||||
Can only be run if the bot is in a server."""
|
||||
if len(ctx.bot.guilds) == 0:
|
||||
await ctx.send_help()
|
||||
return
|
||||
status = ctx.bot.guilds[0].me.status
|
||||
if listening:
|
||||
listening = discord.Game(name=listening, type=2)
|
||||
else:
|
||||
@ -401,8 +410,13 @@ class Core:
|
||||
@_set.command(name="watching")
|
||||
@checks.is_owner()
|
||||
async def _watching(self, ctx, *, watching: str=None):
|
||||
"""Sets Red's watching status"""
|
||||
status = ctx.me.status
|
||||
"""Sets Red's watching status
|
||||
|
||||
Can only be run if the bot is in a server."""
|
||||
if len(ctx.bot.guilds) == 0:
|
||||
await ctx.send_help()
|
||||
return
|
||||
status = ctx.bot.guilds[0].me.status
|
||||
if watching:
|
||||
watching = discord.Game(name=watching, type=3)
|
||||
else:
|
||||
@ -412,14 +426,16 @@ class Core:
|
||||
|
||||
@_set.command()
|
||||
@checks.is_owner()
|
||||
@commands.guild_only()
|
||||
async def status(self, ctx, *, status: str):
|
||||
"""Sets Red's status
|
||||
|
||||
Available statuses:
|
||||
online
|
||||
idle
|
||||
dnd
|
||||
invisible"""
|
||||
invisible
|
||||
|
||||
Can only be run if the bot is in a server."""
|
||||
|
||||
statuses = {
|
||||
"online": discord.Status.online,
|
||||
@ -428,7 +444,10 @@ class Core:
|
||||
"invisible": discord.Status.invisible
|
||||
}
|
||||
|
||||
game = ctx.me.game
|
||||
if len(ctx.bot.guilds) == 0:
|
||||
await ctx.send_help()
|
||||
return
|
||||
game = ctx.bot.guilds[0].me.game
|
||||
|
||||
try:
|
||||
status = statuses[status.lower()]
|
||||
@ -441,12 +460,14 @@ class Core:
|
||||
|
||||
@_set.command()
|
||||
@checks.is_owner()
|
||||
@commands.guild_only()
|
||||
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."""
|
||||
|
||||
status = ctx.me.status
|
||||
if len(ctx.bot.guilds) == 0:
|
||||
await ctx.send_help()
|
||||
return
|
||||
status = ctx.bot.guilds[0].me.status
|
||||
|
||||
if stream_title:
|
||||
stream_title = stream_title.strip()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user