fix typing on message_search internal function

This commit is contained in:
Luna 2021-08-29 01:21:04 -03:00
parent 92dba16237
commit 3ed0ff8176
1 changed files with 8 additions and 5 deletions

View File

@ -62,16 +62,19 @@ async def message_search(
if after: if after:
where_clause += f"AND id > {after}" where_clause += f"AND id > {after}"
return await app.db.fetch( return [
f""" row["id"]
for row in await app.db.fetch(
f"""
SELECT id SELECT id
FROM messages FROM messages
WHERE channel_id = $1 {where_clause} WHERE channel_id = $1 {where_clause}
ORDER BY id DESC ORDER BY id DESC
LIMIT {limit} LIMIT {limit}
""", """,
channel_id, channel_id,
) )
]
async def around_message_search( async def around_message_search(
@ -120,7 +123,7 @@ async def get_messages(channel_id):
result = [] result = []
for message_id in message_ids: for message_id in message_ids:
msg = await app.storage.get_message(message_id["id"], user_id) msg = await app.storage.get_message(message_id, user_id)
if msg is None: if msg is None:
continue continue