From e87896815c31e9c5a069fced929f6b5a7122d89c Mon Sep 17 00:00:00 2001 From: MAX <63972751+maxbooiii@users.noreply.github.com> Date: Mon, 16 Nov 2020 15:18:44 +0100 Subject: [PATCH] [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 --- redbot/core/core_commands.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index dca184555..f8b6b21b5 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -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()