diff --git a/discordbot/cleanup_db_messages.py b/discordbot/cleanup_db_messages.py index c437cc9..c4f1d5e 100644 --- a/discordbot/cleanup_db_messages.py +++ b/discordbot/cleanup_db_messages.py @@ -89,7 +89,7 @@ class Titan(discord.Client): d = session.query(Messages).filter(Messages.channel_id == chanid, ~Messages.id.in_(keep_these)).delete(synchronize_session=False) session.commit() print(" --{} [{}]".format(channel["name"], d)) - d = session.query(Messages).filter(Messages.guild_id == guild.id, ~Messages.channel_id.in_(active_channels)).delete(synchronize_session=False) + d = session.query(Messages).filter(Messages.guild_id == guild.guild_id, ~Messages.channel_id.in_(active_channels)).delete(synchronize_session=False) session.commit() print(" INACTIVE {}".format(d)) print("done!")