diff --git a/masquerade.py b/masquerade.py index f29e852..f243241 100644 --- a/masquerade.py +++ b/masquerade.py @@ -440,6 +440,13 @@ async def on_guild_update(_, after): storyteller.engine.statistics.rename_guild(after.id, after.name) +@bot.event +async def on_guild_channel_delete(channel): + """Removes initiative from the deleted channel.""" + print(f"Deleted #{channel.name} on {channel.guild.name}. Removing initiative.") + storyteller.initiative.remove_table(channel.id) + + @bot.event async def on_command_error(ctx, error): """Ignore CommandNotFound errors."""