fix(main): fixed pylint warning

This commit is contained in:
Seaswimmer 2023-09-24 13:26:08 -04:00
parent e7f569a9b0
commit 2d39b773f4
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

14
main.py
View file

@ -57,21 +57,21 @@ class Client(commands.CommandsClient):
else:
print(f"{message.author.name}#{message.author.discriminator} ({message.author.id}): {message.content}\n ⤷ Deleted from Direct Messages\n Message ID: {message.id}")
async def on_message_update(self, before: revolt.Message, message: revolt.Message):
if isinstance(message.author, revolt.Member):
if message.author.bot is True:
async def on_message_update(self, before: revolt.Message, after: revolt.Message):
if isinstance(after.author, revolt.Member):
if after.author.bot is True:
return
message_link = f"{app_url}/server/{message.server.id}/channel/{message.channel.id}/message/{message.id}"
embeds = [CustomEmbed(description=f"## Message Edited in {message.channel.mention}\n**Author:** {message.author.name}#{message.author.discriminator} ({message.author.id})\n**Message ID:** [{message.id}]({message_link})", colour="#5d82d1"), CustomEmbed(title="Old Content", description=before.content, colour="#5d82d1"), CustomEmbed(title="New Content", description=message.content, colour="#5d82d1")]
message_link = f"{app_url}/server/{after.server.id}/channel/{after.channel.id}/message/{after.id}"
embeds = [CustomEmbed(description=f"## Message Edited in {after.channel.mention}\n**Author:** {after.author.name}#{after.author.discriminator} ({after.author.id})\n**Message ID:** [{after.id}]({message_link})", colour="#5d82d1"), CustomEmbed(title="Old Content", description=before.content, colour="#5d82d1"), CustomEmbed(title="New Content", description=after.content, colour="#5d82d1")]
channel = self.get_channel(message_logging_channel)
try:
await channel.send(embed=embeds[0])
await channel.send(embed=embeds[1])
await channel.send(embed=embeds[2])
except LookupError:
print("Message logging channel not found for server ID: " + message.server.id)
print("Message logging channel not found for server ID: " + after.server.id)
else:
print(f"{message.author.name}#{message.author.discriminator} ({message.author.id}): {before.content}\n ⤷ Edited in Direct Messages\n New Content: {message.content}")
print(f"{after.author.name}#{after.author.discriminator} ({after.author.id}): {before.content}\n ⤷ Edited in Direct Messages\n New Content: {after.content}")
@commands.command()
async def ping(self, ctx: commands.Context):