Skip to content

Commit

Permalink
Update OC channel edit logic
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhsm committed Jan 5, 2024
1 parent 8cf13e5 commit 824ae68
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions dictator/cogs/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,21 @@
from get_version import get_dictator_version

import random
import logging


class System(commands.Cog):
def __init__(self, dictator: commands.Bot) -> None:
self.dictator = dictator
logging.basicConfig(level=logging.INFO)

@commands.Cog.listener()
async def on_message(self, message: discord.Message):
if not message.channel.id == OC_CHANNEL_ID:
return

logging.info(f"Message sent in OC channel ({message.id})")

if not message.webhook_id:
return

logging.info(f"Message sent by webhook ({message.id})")

if message.embeds:
await message.edit(suppress=True)
logging.info(f"Message edited ({message.id})")
return

logging.info(f"Message not edited ({message.id})")

await message.edit(suppress=True)

@app_commands.command()
async def ping(self, interaction: discord.Interaction) -> None:
Expand Down

0 comments on commit 824ae68

Please sign in to comment.