From 21eb7f513cd463a51d4b079723859a09eecf573f Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Mon, 13 May 2019 21:05:37 -0500 Subject: [PATCH] Fixed send_list and register command + send_list was updated to track the raw msg size + register was missing a format --- GeoffreyBot/geoffrey.py | 5 +---- GeoffreyBot/geoffrey_api.py | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/GeoffreyBot/geoffrey.py b/GeoffreyBot/geoffrey.py index f5eae1c..ba86c6c 100644 --- a/GeoffreyBot/geoffrey.py +++ b/GeoffreyBot/geoffrey.py @@ -129,17 +129,14 @@ class GeoffreyBot(commands.Bot): @staticmethod async def send_list(ctx, send_list): - size = 0 msg = "" for s in send_list: - if (size + len(s)) > 2000: + if (len(msg) + len(s)) > 2000: await ctx.send(msg) msg = s - size = len(s) else: msg = msg + '\n' + s - size = size + len(s) if len(msg) > 0: await ctx.send(msg) diff --git a/GeoffreyBot/geoffrey_api.py b/GeoffreyBot/geoffrey_api.py index 83ed2f0..eac53c7 100644 --- a/GeoffreyBot/geoffrey_api.py +++ b/GeoffreyBot/geoffrey_api.py @@ -543,9 +543,9 @@ class GeoffreyCommands(commands.Cog): await run_command(ctx, self.base_url, self.api_token, "POST", "register", errors=errors, player_name=ctx.message.author.display_name, discord_uuid=ctx.message.author.id) - await ctx.send("{}, you have been added to the database. Do {}help to see what this bot can do.", + await ctx.send("{}, you have been added to the database. Do {}help to see what this bot can do.".format( ctx.message.author.mention, - self.bot.prefix) + self.bot.prefix)) @commands.command(pass_context=True) async def remove_resident(self, ctx, resident_name, *args):