/setup command implemented

This commit is contained in:
2023-08-28 15:41:20 +02:00
parent 35a8cd4b2b
commit 30b48c12f3
5 changed files with 182 additions and 76 deletions

View File

@@ -2,7 +2,7 @@ from typing import List, Union
from apscheduler.triggers.cron import CronTrigger
from libbot.pyrogram.classes import PyroClient as LibPyroClient
from pymongo import ASCENDING, GEO2D
from pymongo import ASCENDING, GEOSPHERE, TEXT
from pyrogram.types import User
from classes.location import Location
@@ -24,9 +24,10 @@ class PyroClient(LibPyroClient):
[("id", ASCENDING)], name="location_id", unique=True
)
await col_locations.create_index(
[("location", GEO2D)],
[("location", GEOSPHERE)],
name="location_location",
)
await col_locations.create_index([("name", TEXT)], name="location_name")
return await super().start(**kwargs)
async def find_user(self, user: Union[int, User]) -> PyroUser: