From f031820dde5a66643102d9dae51e11342b4685a2 Mon Sep 17 00:00:00 2001 From: aikaterna <20862007+aikaterna@users.noreply.github.com> Date: Tue, 31 Mar 2020 12:26:57 -0700 Subject: [PATCH] [Tools] Fix inrole with role list --- tools/tools.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/tools.py b/tools/tools.py index 9d51e30..88b848c 100644 --- a/tools/tools.py +++ b/tools/tools.py @@ -288,14 +288,14 @@ class Tools(commands.Cog): await ctx.send("No roles were found") return else: - msg = "**Roles found with** {} **in the name.**\n\n".format(rolename) + msg = "**Roles found with** {} **in the name.**\nType the number of the role you wish to see.\n\n".format(rolename) tbul8 = [] for num, role in enumerate(roles): tbul8.append([num + 1, role.name]) m1 = await ctx.send(msg + tabulate(tbul8, tablefmt="plain")) def check(m): - if (m.author == author) and (m.channel == ctx.channel): + if (m.author == ctx.author) and (m.channel == ctx.channel): return True response = await self.bot.wait_for("message", check=check, timeout=25) @@ -309,10 +309,9 @@ class Tools(commands.Cog): response = int(response.content) if response not in range(0, len(roles) + 1): - return + return await ctx.send("Cancelled.") elif response == 0: - await ctx.send("Cancelled.") - return + return await ctx.send("Cancelled.") else: role = roles[response - 1]