[Core] Add [p]set competing command (#4609)

* Update core_commands.py

* style

* Update core_commands.py

* Update core_commands.py

* does this fix tho?

* C
This commit is contained in:
MAX 2020-11-16 15:18:44 +01:00 committed by GitHub
parent 0f7a3bf6f8
commit e87896815c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1896,6 +1896,25 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
else:
await ctx.send(_("Watching cleared."))
@_set.command(name="competing")
@checks.bot_in_a_guild()
@checks.is_owner()
async def _competing(self, ctx: commands.Context, *, competing: str = None):
"""Sets [botname]'s competing status."""
status = ctx.bot.guilds[0].me.status if len(ctx.bot.guilds) > 0 else discord.Status.online
if competing:
activity = discord.Activity(name=competing, type=discord.ActivityType.competing)
else:
activity = None
await ctx.bot.change_presence(status=status, activity=activity)
if activity:
await ctx.send(
_("Status set to ``Competing in {competing}``.").format(competing=competing)
)
else:
await ctx.send(_("Competing cleared."))
@_set.command()
@checks.bot_in_a_guild()
@checks.is_owner()