fix(aurora): cast timestamps to integers
Some checks failed
Actions / Build Documentation (MkDocs) (pull_request) Failing after 28s
Actions / Lint Code (Ruff & Pylint) (pull_request) Successful in 39s

This commit is contained in:
Seaswimmer 2024-08-10 13:34:15 -04:00
parent 14dc256919
commit 14750787b2
Signed by: cswimr
GPG key ID: 3813315477F26F82

View file

@ -321,10 +321,10 @@ class Moderation(AuroraGuildModel):
params.append(t.key)
if before:
query += " WHERE timestamp < ?"
params.append(before.timestamp())
params.append(int(before.timestamp()))
if after:
query += " WHERE timestamp > ?"
params.append(after.timestamp())
params.append(int(after.timestamp()))
if limit:
query += " LIMIT ? OFFSET ?"
params.extend((limit, offset))
@ -354,10 +354,10 @@ class Moderation(AuroraGuildModel):
params.append(t.key)
if before:
query += " AND timestamp < ?"
params.append(before.timestamp())
params.append(int(before.timestamp()))
if after:
query += " AND timestamp > ?"
params.append(after.timestamp())
params.append(int(after.timestamp()))
query += " ORDER BY moderation_id DESC;"
return await cls.execute(bot=bot, guild_id=guild_id, query=query, parameters=params, cursor=cursor)
@ -372,10 +372,10 @@ class Moderation(AuroraGuildModel):
params.append(t.key)
if before:
query += " AND timestamp < ?"
params.append(before.timestamp())
params.append(int(before.timestamp()))
if after:
query += " AND timestamp > ?"
params.append(after.timestamp())
params.append(int(after.timestamp()))
query += " ORDER BY moderation_id DESC;"
return await cls.execute(bot=bot, guild_id=guild_id, query=query, parameters=params, cursor=cursor)