diff options
Diffstat (limited to 'bot/exts')
| -rw-r--r-- | bot/exts/utilities/issues.py | 19 | 
1 files changed, 14 insertions, 5 deletions
| diff --git a/bot/exts/utilities/issues.py b/bot/exts/utilities/issues.py index 8a7ebed0..36655e1b 100644 --- a/bot/exts/utilities/issues.py +++ b/bot/exts/utilities/issues.py @@ -185,7 +185,7 @@ class Issues(commands.Cog):          return resp      @whitelist_override(channels=WHITELISTED_CHANNELS, categories=WHITELISTED_CATEGORIES) -    @commands.command(aliases=("pr",)) +    @commands.command(aliases=("issues", "pr", "prs"))      async def issue(          self,          ctx: commands.Context, @@ -197,14 +197,23 @@ class Issues(commands.Cog):          # Remove duplicates          numbers = set(numbers) -        if len(numbers) > MAXIMUM_ISSUES: -            embed = discord.Embed( +        err_message = None +        if not numbers: +            err_message = "You must have at least one issue/PR!" + +        elif len(numbers) > MAXIMUM_ISSUES: +            err_message = f"Too many issues/PRs! (maximum of {MAXIMUM_ISSUES})" + +        # If there's an error with command invocation then send an error embed +        if err_message is not None: +            err_embed = discord.Embed(                  title=random.choice(ERROR_REPLIES),                  color=Colours.soft_red, -                description=f"Too many issues/PRs! (maximum of {MAXIMUM_ISSUES})" +                description=err_message              ) -            await ctx.send(embed=embed) +            await ctx.send(embed=err_embed)              await invoke_help_command(ctx) +            return          results = [await self.fetch_issues(number, repository, user) for number in numbers]          await ctx.send(embed=self.format_embed(results, user, repository)) | 
