Message and error logging, various bugfixes

This commit is contained in:
Ske
2018-10-27 23:30:12 +02:00
parent ea62ede21b
commit 58d8927380
7 changed files with 161 additions and 37 deletions

View File

@@ -38,13 +38,13 @@ def status(text: str) -> discord.Embed:
return embed
def exception_log(message_content, author_name, author_discriminator, server_id, channel_id) -> discord.Embed:
def exception_log(message_content, author_name, author_discriminator, author_id, server_id, channel_id) -> discord.Embed:
embed = discord.Embed()
embed.colour = discord.Colour.dark_red()
embed.title = message_content
embed.set_footer(text="Sender: {}#{} | Server: {} | Channel: {}".format(
author_name, author_discriminator,
embed.set_footer(text="Sender: {}#{} ({}) | Server: {} | Channel: {}".format(
author_name, author_discriminator, author_id,
server_id if server_id else "(DMs)",
channel_id
))
@@ -72,7 +72,7 @@ async def system_card(conn, client: discord.Client, system: System) -> discord.E
account_names = []
for account_id in await system.get_linked_account_ids(conn):
account = await client.get_user_info(str(account_id))
account = await client.get_user_info(account_id)
account_names.append("{}#{}".format(account.name, account.discriminator))
card.add_field(name="Linked accounts", value="\n".join(account_names))