mirror of
https://github.com/BluemediaGER/discord-cleanup-bot.git
synced 2024-11-23 00:05:29 +01:00
Handle channel deletions
This commit is contained in:
parent
8d01e6ff5a
commit
7597569307
9
bot.py
9
bot.py
|
@ -80,6 +80,15 @@ async def on_guild_remove(guild):
|
|||
session.delete(removed_guild)
|
||||
session.commit()
|
||||
|
||||
@client.event
|
||||
async def on_guild_channel_delete(channel):
|
||||
with Session(sqla_engine) as session:
|
||||
removed_channel = session.get(Channel, channel.id)
|
||||
if removed_channel == None:
|
||||
return
|
||||
session.delete(removed_channel)
|
||||
session.commit()
|
||||
|
||||
@client.tree.command()
|
||||
@app_commands.guild_only()
|
||||
@app_commands.describe(
|
||||
|
|
Loading…
Reference in a new issue