From dc0ab7d0d73b9050c4b90437d2bcc407714ea5e0 Mon Sep 17 00:00:00 2001 From: Milka64 Date: Sun, 21 Nov 2021 16:38:30 +0100 Subject: [PATCH] try to fix schizo cmd --- kabot/kabot/kabot.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kabot/kabot/kabot.py b/kabot/kabot/kabot.py index c0f9654..b0c5c20 100644 --- a/kabot/kabot/kabot.py +++ b/kabot/kabot/kabot.py @@ -418,7 +418,8 @@ class Mybot(commands.Cog): await channel.send(sentence) @commands.command(help='Who the fuck am i?') - async def schizo(self, ctx, name=None): + async def schizo(self, ctx, *names): + name = ' '.join(name) list_name = ["Kabot", "Gaspard et Balthazar", "Bender", "Zoidberg", "Gunther"] try: current_name = self.bot.user.name @@ -427,9 +428,11 @@ class Mybot(commands.Cog): pass if not name: name = random.choice(list_name) - if name in list_name: + lower_names = [x.lower() for x in list_name] + if name.lower() in lower_names: if name: - await self.bot.user.edit(username=name) + correct_name = [x for x in list_name if x.lower() in nama.lower()][0] + await self.bot.user.edit(username=correct_name) else: name = "404" await self.bot.user.edit(username="Error 404 name not found!")