From 4121d647df8df4509ad88f7e863953e5cc9d6a20 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Fri, 8 Sep 2017 20:44:26 +0000 Subject: [PATCH] Cast message and channel ids to bigint for comparison --- webapp/titanembeds/database/messages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/titanembeds/database/messages.py b/webapp/titanembeds/database/messages.py index fbe497f..8d0f205 100644 --- a/webapp/titanembeds/database/messages.py +++ b/webapp/titanembeds/database/messages.py @@ -33,7 +33,7 @@ def get_channel_messages(guild_id, channel_id, after_snowflake=None): if not after_snowflake: q = db.session.query(Messages).filter(Messages.channel_id == channel_id).order_by(Messages.timestamp.desc()).limit(50) else: - q = db.session.query(Messages).filter(cast(Messages.channel_id, db.Integer) == int(channel_id)).filter(Messages.message_id > after_snowflake).order_by(Messages.timestamp.desc()).limit(50) + q = db.session.query(Messages).filter(cast(Messages.channel_id, db.BigInteger) == int(channel_id)).filter(cast(Messages.message_id, db.BigInteger) > after_snowflake).order_by(Messages.timestamp.desc()).limit(50) msgs = [] snowflakes = [] for x in q: