Fixed send_list and register command

+ send_list was updated to track the raw msg size
+ register was missing a format
master
Joey Hines 2019-05-13 21:05:37 -05:00
parent 7c29e6e9b0
commit 21eb7f513c
2 changed files with 3 additions and 6 deletions

View File

@ -129,17 +129,14 @@ class GeoffreyBot(commands.Bot):
@staticmethod @staticmethod
async def send_list(ctx, send_list): async def send_list(ctx, send_list):
size = 0
msg = "" msg = ""
for s in send_list: for s in send_list:
if (size + len(s)) > 2000: if (len(msg) + len(s)) > 2000:
await ctx.send(msg) await ctx.send(msg)
msg = s msg = s
size = len(s)
else: else:
msg = msg + '\n' + s msg = msg + '\n' + s
size = size + len(s)
if len(msg) > 0: if len(msg) > 0:
await ctx.send(msg) await ctx.send(msg)

View File

@ -543,9 +543,9 @@ class GeoffreyCommands(commands.Cog):
await run_command(ctx, self.base_url, self.api_token, "POST", "register", errors=errors, await run_command(ctx, self.base_url, self.api_token, "POST", "register", errors=errors,
player_name=ctx.message.author.display_name, player_name=ctx.message.author.display_name,
discord_uuid=ctx.message.author.id) 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, ctx.message.author.mention,
self.bot.prefix) self.bot.prefix))
@commands.command(pass_context=True) @commands.command(pass_context=True)
async def remove_resident(self, ctx, resident_name, *args): async def remove_resident(self, ctx, resident_name, *args):