diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index f8d493fa8..083f0a070 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -1079,21 +1079,19 @@ class Core(commands.Cog, CoreLogic): async def _game(self, ctx: commands.Context, *, game: str = None): """Sets [botname]'s playing status""" - if len(game) > 128: - await ctx.send("The maximum length of game descriptions is 128 characters.") + if game: + if len(game) > 128: + await ctx.send("The maximum length of game descriptions is 128 characters.") + return + game = discord.Game(name=game) else: - if game: - game = discord.Game(name=game) - else: - game = None - status = ( - ctx.bot.guilds[0].me.status if len(ctx.bot.guilds) > 0 else discord.Status.online - ) - await ctx.bot.change_presence(status=status, activity=game) - if game: - await ctx.send(_("Status set to ``Playing {game.name}``.").format(game=game)) - else: - await ctx.send(_("Game cleared.")) + game = None + status = ctx.bot.guilds[0].me.status if len(ctx.bot.guilds) > 0 else discord.Status.online + await ctx.bot.change_presence(status=status, activity=game) + if game: + await ctx.send(_("Status set to ``Playing {game.name}``.").format(game=game)) + else: + await ctx.send(_("Game cleared.")) @_set.command(name="listening") @checks.bot_in_a_guild()