From 1248efd20fcf1c4c3e45a133ae8f4191e873d260 Mon Sep 17 00:00:00 2001 From: profitroll Date: Wed, 30 Aug 2023 14:01:30 +0200 Subject: [PATCH] Fixed results order --- modules/search_name.py | 2 +- modules/search_nearby.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/search_name.py b/modules/search_name.py index 1f3caf7..7c918c4 100644 --- a/modules/search_name.py +++ b/modules/search_name.py @@ -46,7 +46,7 @@ async def search_name(app: PyroClient, message: Message) -> Union[Location, None query = {"$text": {"$search": answer.text}} - locations = await col_locations.find(query).limit(6).to_list() + locations = (await col_locations.find(query).limit(6).to_list()).reverse() if len(locations) == 0: await message.reply_text( diff --git a/modules/search_nearby.py b/modules/search_nearby.py index be94d8e..332a9ea 100644 --- a/modules/search_nearby.py +++ b/modules/search_nearby.py @@ -24,7 +24,7 @@ async def search_nearby(app: PyroClient, message: Message) -> Union[Location, No } } - locations = await col_locations.find(query).limit(6).to_list() + locations = (await col_locations.find(query).limit(6).to_list()).reverse() if len(locations) == 0: await message.reply_text(