From 6b5af514294359d484189bfd063346d5cba39f57 Mon Sep 17 00:00:00 2001 From: sgoudham Date: Wed, 17 Jun 2020 21:39:52 +0100 Subject: [PATCH] Allowing for error handling when a person doesn't exist in the ~enso command --- cogs/WaifuImages.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cogs/WaifuImages.py b/cogs/WaifuImages.py index 8901abbd..5ddeffeb 100644 --- a/cogs/WaifuImages.py +++ b/cogs/WaifuImages.py @@ -119,10 +119,10 @@ class Waifus(commands.Cog): @commands.command(aliases=['enso', 'Ensoperson']) @cooldown(1, 0.5, BucketType.channel) async def ensoperson(self, ctx, name=None): - array = string.capwords(['hussein', 'inna', 'kaiju', 'kate', 'lukas', - 'marshall', 'stitch', 'zara', 'josh', 'ange', - 'gria', 'lilu', 'marcus', 'eric', 'ifrah', - 'janet', 'connor', 'taz', 'ryder', 'clarity']) + array = ['hussein', 'inna', 'kaiju', 'kate', 'lukas', + 'marshall', 'stitch', 'zara', 'josh', 'ange', + 'gria', 'lilu', 'marcus', 'eric', 'ifrah', + 'janet', 'connor', 'taz', 'ryder', 'clarity'] proper_name = name.lower() @@ -138,10 +138,8 @@ class Waifus(commands.Cog): await ctx.send(f"Sorry! That person doesn't exist!! Try the names listed below!") - col_width = max(len(word) for row in array for word in row) + 2 # padding - for row in array: - formattedmsg = ("".join(word.ljust(col_width) for word in row)) - await ctx.send(formattedmsg) + nice = string.capwords(', '.join(map(str, array))) + await ctx.send(nice) else: