mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Add message count to export file. Closes #43.
This commit is contained in:
parent
3e7800971b
commit
a5265b318f
1 changed files with 7 additions and 2 deletions
|
|
@ -52,6 +52,8 @@ async def invite_link(ctx: CommandContext):
|
|||
|
||||
|
||||
async def export(ctx: CommandContext):
|
||||
working_msg = await ctx.message.channel.send("Working...")
|
||||
|
||||
system = await ctx.ensure_system()
|
||||
|
||||
members = await system.get_members(ctx.conn)
|
||||
|
|
@ -76,7 +78,8 @@ async def export(ctx: CommandContext):
|
|||
"description": member.description,
|
||||
"prefix": member.prefix,
|
||||
"suffix": member.suffix,
|
||||
"created": member.created.isoformat()
|
||||
"created": member.created.isoformat(),
|
||||
"message_count": await member.message_count(ctx.conn)
|
||||
} for member in members
|
||||
],
|
||||
"accounts": [str(uid) for uid in accounts],
|
||||
|
|
@ -88,8 +91,10 @@ async def export(ctx: CommandContext):
|
|||
] # TODO: messages
|
||||
}
|
||||
|
||||
await working_msg.delete()
|
||||
|
||||
f = io.BytesIO(json.dumps(data).encode("utf-8"))
|
||||
await ctx.message.channel.send(content="Here you go!", file=discord.File(fp=f, filename="system.json"))
|
||||
await ctx.message.channel.send(content="Here you go!", file=discord.File(fp=f, filename="pluralkit_system.json"))
|
||||
|
||||
|
||||
async def tell(ctx: CommandContext):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue