Add Info Cog #11
1 changed files with 14 additions and 5 deletions
19
main.py
19
main.py
|
@ -47,11 +47,20 @@ class Client(commands.CommandsClient):
|
||||||
else:
|
else:
|
||||||
print(f"{message.author.name}#{message.author.discriminator} ({message.author.id}): {message.content}\n ⤷ Deleted from Direct Messages\n Message ID: {message.id}")
|
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, message: revolt.Message):
|
async def on_message_update(self, before: revolt.Message, message: revolt.Message):
|
||||||
# if isinstance(message.author, revolt.Member):
|
if isinstance(message.author, revolt.Member):
|
||||||
# print(f"{message.author.name}#{message.author.discriminator} ({message.author.id}): {message.content}\n ⤷ Sent from {message.server.name} ({message.server.id})")
|
if message.author.bot is True:
|
||||||
# else:
|
return
|
||||||
# print(f"{message.author.name}#{message.author.discriminator} ({message.author.id}): {message.content}\n ⤷ Sent in Direct Messages")
|
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}", colour="#5d82d1"), CustomEmbed(title="Old Content", description=before.content, colour="#5d82d1"), CustomEmbed(title="New Content", description=message.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)
|
||||||
|
else:
|
||||||
|
print(f"{message.author.name}#{message.author.discriminator} ({message.author.id}): {before.content}\n ⤷ Edited in Direct Messages\n New Content: {message.content}")
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def ping(self, ctx: commands.Context):
|
async def ping(self, ctx: commands.Context):
|
||||||
|
|
Loading…
Reference in a new issue