Compare commits
2 commits
e7f569a9b0
...
944204a441
Author | SHA1 | Date | |
---|---|---|---|
944204a441 | |||
2d39b773f4 |
2 changed files with 10 additions and 10 deletions
|
@ -20,8 +20,8 @@ db = os.getenv('DB')
|
|||
required_role_id = os.getenv('REQUIRED_ROLE_ID')
|
||||
|
||||
class Moderation(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
def __init__(self, client):
|
||||
self.client: revolt.Client = client
|
||||
disable_dateutil()
|
||||
|
||||
def mysql_connect(self):
|
||||
|
@ -66,7 +66,7 @@ class Moderation(commands.Cog):
|
|||
return
|
||||
|
||||
async def tempban_handler(self):
|
||||
for server in self.servers:
|
||||
for server in self.client.servers:
|
||||
database = Moderation.mysql_connect(self)
|
||||
cursor = database.cursor()
|
||||
bans = await server.fetch_bans()
|
||||
|
|
14
main.py
14
main.py
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue