Fixed send_list and register command
+ send_list was updated to track the raw msg size + register was missing a formatmaster
parent
7c29e6e9b0
commit
21eb7f513c
|
@ -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)
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue