From fd5a851d2a5f2a30cc8167aa463ca7262dfae0d1 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Fri, 22 Sep 2017 01:42:49 +0000 Subject: [PATCH] cleanup db message fix, guild_id --- discordbot/cleanup_db_messages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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!")