mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-15 02:00:09 +00:00
Message and error logging, various bugfixes
This commit is contained in:
parent
ea62ede21b
commit
58d8927380
7 changed files with 161 additions and 37 deletions
|
|
@ -8,7 +8,7 @@ async def get_message_contents(client: discord.Client, channel_id: int, message_
|
|||
channel = client.get_channel(str(channel_id))
|
||||
if channel:
|
||||
try:
|
||||
original_message = await client.get_message(channel, str(message_id))
|
||||
original_message = await client.get_channel(channel).get_message(message_id)
|
||||
return original_message.content or None
|
||||
except (discord.errors.Forbidden, discord.errors.NotFound):
|
||||
pass
|
||||
|
|
@ -24,13 +24,13 @@ async def message_info(ctx: CommandContext):
|
|||
return CommandError("You must pass a valid number as a message ID.", help=help.message_lookup)
|
||||
|
||||
# Find the message in the DB
|
||||
message = await db.get_message(ctx.conn, str(mid))
|
||||
message = await db.get_message(ctx.conn, mid)
|
||||
if not message:
|
||||
raise CommandError("Message with ID '{}' not found.".format(mid))
|
||||
|
||||
# Get the original sender of the messages
|
||||
try:
|
||||
original_sender = await ctx.client.get_user_info(str(message.sender))
|
||||
original_sender = await ctx.client.get_user_info(message.sender)
|
||||
except discord.NotFound:
|
||||
# Account was since deleted - rare but we're handling it anyway
|
||||
original_sender = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue