Changed "loc" to "location" in application
This commit is contained in:
@@ -22,7 +22,7 @@ async def cmd_nearby(app: Client, msg: Message):
|
||||
if application is None:
|
||||
await msg.reply_text(locale("nearby_user_empty", "message", locale=holo_user))
|
||||
return
|
||||
location = application["application"]["3"]["loc"][0], application["application"]["3"]["loc"][1]
|
||||
location = application["application"]["3"]["location"][0], application["application"]["3"]["location"][1]
|
||||
else: # Find a place from input query
|
||||
logWrite(f"Looking for the location by query '{' '.join(msg.command[1:])}'")
|
||||
try:
|
||||
@@ -37,8 +37,8 @@ async def cmd_nearby(app: Client, msg: Message):
|
||||
|
||||
# Find all users registered in the area provided
|
||||
output = []
|
||||
applications_nearby = col_applications.find( {"application.3.loc": { "$nearSphere": {"$geometry": {"type": "Point", "coordinates": [location[0], location[1]]}, "$maxDistance": configGet("search_radius")*1000} } } )
|
||||
# {"application": {"3": {"loc": {"$near": { "$geometry": { "type": "Point", "coordinates": location }, "$maxDistance": 30000 }} } } } )
|
||||
applications_nearby = col_applications.find( {"application.3.location": { "$nearSphere": {"$geometry": {"type": "Point", "coordinates": [location[0], location[1]]}, "$maxDistance": configGet("search_radius")*1000} } } )
|
||||
# {"application": {"3": {"location": {"$near": { "$geometry": { "type": "Point", "coordinates": location }, "$maxDistance": 30000 }} } } } )
|
||||
|
||||
for entry in applications_nearby:
|
||||
if not entry["user"] == msg.from_user.id:
|
||||
|
Reference in New Issue
Block a user