Skip to content

Commit

Permalink
Remove initiative when the channel is deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
tiltowait committed May 9, 2021
1 parent 1d1c14c commit 9561a32
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions masquerade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down

0 comments on commit 9561a32

Please sign in to comment.