Skip to content

Commit

Permalink
Automatically delete Open Collective embeds
Browse files Browse the repository at this point in the history
Keeps the channel neater
  • Loading branch information
connorhsm committed Jan 2, 2024
1 parent c1d87d4 commit d6cfd88
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion dictator/cogs/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from discord import app_commands
from discord.ext import commands

from constants import MOD_ROLE_ID
from constants import MOD_ROLE_ID, OC_CHANNEL_ID
from get_version import get_dictator_version

import random
Expand All @@ -12,6 +12,17 @@ class System(commands.Cog):
def __init__(self, dictator: commands.Bot) -> None:
self.dictator = dictator

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

if not message.webhook_id:
return

if message.embeds:
await message.edit(suppress=True)

@app_commands.command()
async def ping(self, interaction: discord.Interaction) -> None:
"""Check the latency between Discord and Dictator."""
Expand Down

0 comments on commit d6cfd88

Please sign in to comment.