cleanup db message fix, guild_id

This commit is contained in:
Jeremy Zhang 2017-09-22 01:42:49 +00:00
parent f46d33c943
commit fd5a851d2a

View File

@ -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!")