Move system/member card embeds to embeds.py

This commit is contained in:
Ske
2018-09-16 19:36:50 +02:00
parent 345e8baab6
commit 6951c15167
4 changed files with 102 additions and 94 deletions

View File

@@ -1,5 +1,6 @@
from datetime import datetime
import pluralkit.bot.embeds
from pluralkit.bot import help
from pluralkit.bot.commands import *
from pluralkit.errors import PluralKitError
@@ -10,7 +11,7 @@ logger = logging.getLogger("pluralkit.commands")
async def member_info(ctx: CommandContext):
member = await ctx.pop_member(
error=CommandError("You must pass a member name or ID.", help=help.lookup_member), system_only=False)
await ctx.reply(embed=await utils.generate_member_info_card(ctx.conn, member))
await ctx.reply(embed=await pluralkit.bot.embeds.member_card(ctx.conn, member))
async def new_member(ctx: CommandContext):

View File

@@ -2,6 +2,7 @@ import dateparser
import humanize
from datetime import datetime, timedelta
import pluralkit.bot.embeds
import pluralkit.utils
from pluralkit.bot import help
from pluralkit.bot.commands import *
@@ -16,7 +17,7 @@ async def system_info(ctx: CommandContext):
else:
system = await ctx.ensure_system()
await ctx.reply(embed=await utils.generate_system_info_card(ctx.conn, ctx.client, system))
await ctx.reply(embed=await pluralkit.bot.embeds.system_card(ctx.conn, ctx.client, system))
async def new_system(ctx: CommandContext):