Compare commits

..

No commits in common. "944204a441f326c1779b4dfad84663fe06610536" and "e7f569a9b0adfeb13a1308e0de09027814ea1aa6" have entirely different histories.

2 changed files with 10 additions and 10 deletions

View file

@ -20,8 +20,8 @@ db = os.getenv('DB')
required_role_id = os.getenv('REQUIRED_ROLE_ID') required_role_id = os.getenv('REQUIRED_ROLE_ID')
class Moderation(commands.Cog): class Moderation(commands.Cog):
def __init__(self, client): def __init__(self, bot):
self.client: revolt.Client = client self.bot = bot
disable_dateutil() disable_dateutil()
def mysql_connect(self): def mysql_connect(self):
@ -66,7 +66,7 @@ class Moderation(commands.Cog):
return return
async def tempban_handler(self): async def tempban_handler(self):
for server in self.client.servers: for server in self.servers:
database = Moderation.mysql_connect(self) database = Moderation.mysql_connect(self)
cursor = database.cursor() cursor = database.cursor()
bans = await server.fetch_bans() bans = await server.fetch_bans()

14
main.py
View file

@ -57,21 +57,21 @@ 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, before: revolt.Message, after: revolt.Message): async def on_message_update(self, before: revolt.Message, message: revolt.Message):
if isinstance(after.author, revolt.Member): if isinstance(message.author, revolt.Member):
if after.author.bot is True: if message.author.bot is True:
return return
message_link = f"{app_url}/server/{after.server.id}/channel/{after.channel.id}/message/{after.id}" message_link = f"{app_url}/server/{message.server.id}/channel/{message.channel.id}/message/{message.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")] 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")]
channel = self.get_channel(message_logging_channel) channel = self.get_channel(message_logging_channel)
try: try:
await channel.send(embed=embeds[0]) await channel.send(embed=embeds[0])
await channel.send(embed=embeds[1]) await channel.send(embed=embeds[1])
await channel.send(embed=embeds[2]) await channel.send(embed=embeds[2])
except LookupError: except LookupError:
print("Message logging channel not found for server ID: " + after.server.id) print("Message logging channel not found for server ID: " + message.server.id)
else: else:
print(f"{after.author.name}#{after.author.discriminator} ({after.author.id}): {before.content}\n ⤷ Edited in Direct Messages\n New Content: {after.content}") 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):