Allowing for error handling when a person doesn't exist in the ~enso command

pull/2/head
sgoudham 5 years ago
parent 428414e32e
commit 6b5af51429

@ -119,10 +119,10 @@ class Waifus(commands.Cog):
@commands.command(aliases=['enso', 'Ensoperson']) @commands.command(aliases=['enso', 'Ensoperson'])
@cooldown(1, 0.5, BucketType.channel) @cooldown(1, 0.5, BucketType.channel)
async def ensoperson(self, ctx, name=None): async def ensoperson(self, ctx, name=None):
array = string.capwords(['hussein', 'inna', 'kaiju', 'kate', 'lukas', array = ['hussein', 'inna', 'kaiju', 'kate', 'lukas',
'marshall', 'stitch', 'zara', 'josh', 'ange', 'marshall', 'stitch', 'zara', 'josh', 'ange',
'gria', 'lilu', 'marcus', 'eric', 'ifrah', 'gria', 'lilu', 'marcus', 'eric', 'ifrah',
'janet', 'connor', 'taz', 'ryder', 'clarity']) 'janet', 'connor', 'taz', 'ryder', 'clarity']
proper_name = name.lower() 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!") 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 nice = string.capwords(', '.join(map(str, array)))
for row in array: await ctx.send(nice)
formattedmsg = ("".join(word.ljust(col_width) for word in row))
await ctx.send(formattedmsg)
else: else:

Loading…
Cancel
Save