mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-15 02:21:21 +01:00
Cast message and channel ids to bigint for comparison
This commit is contained in:
parent
b345b2ab6f
commit
4121d647df
@ -33,7 +33,7 @@ def get_channel_messages(guild_id, channel_id, after_snowflake=None):
|
|||||||
if not after_snowflake:
|
if not after_snowflake:
|
||||||
q = db.session.query(Messages).filter(Messages.channel_id == channel_id).order_by(Messages.timestamp.desc()).limit(50)
|
q = db.session.query(Messages).filter(Messages.channel_id == channel_id).order_by(Messages.timestamp.desc()).limit(50)
|
||||||
else:
|
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 = []
|
msgs = []
|
||||||
snowflakes = []
|
snowflakes = []
|
||||||
for x in q:
|
for x in q:
|
||||||
|
Loading…
Reference in New Issue
Block a user