Make API token send in new message for mobile-friendly copying

This commit is contained in:
Bella | Nightshade 2019-03-27 08:49:34 +09:30 committed by Astrid
parent e9792bd5ec
commit 8e3d91d5ae

View File

@ -18,14 +18,17 @@ async def token_get(ctx: CommandContext):
else: else:
token = await system.refresh_token(ctx.conn) token = await system.refresh_token(ctx.conn)
token_message = "Here's your API token: \n**`{}`**\n{}".format(token, disclaimer) token_message = "{}\n\u2705 Here's your API token:".format(disclaimer)
return await ctx.reply_ok_dm(token_message) if token:
await ctx.message.author.send(token_message)
await ctx.message.author.send(token)
return
async def token_refresh(ctx: CommandContext): async def token_refresh(ctx: CommandContext):
system = await ctx.ensure_system() system = await ctx.ensure_system()
token = await system.refresh_token(ctx.conn) token = await system.refresh_token(ctx.conn)
token_message = "Your previous API token has been invalidated. You will need to change it anywhere it's currently used.\nHere's your new API token:\n**`{}`**\n{}".format( token_message = "Your previous API token has been invalidated. You will need to change it anywhere it's currently used.\n{}\n\u2705 Here's your new API token:".format(disclaimer)
token, disclaimer) if token:
return await ctx.reply_ok_dm(token_message) await ctx.message.author.send(token_message)
await ctx.message.author.send(token)