mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-11 16:20:13 +00:00
Make API token send in new message for mobile-friendly copying
This commit is contained in:
parent
cf5ebeea06
commit
b76bf4f49b
1 changed files with 9 additions and 6 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue