mirror of
https://github.com/kurbezz/discord-bot.git
synced 2026-03-03 22:00:48 +01:00
Update
This commit is contained in:
@@ -6,6 +6,17 @@ from .base import BaseRepository
|
||||
class UserRepository(BaseRepository):
|
||||
COLLECTION_NAME = "users"
|
||||
|
||||
@classmethod
|
||||
async def get(cls, user_id: str) -> User:
|
||||
async with cls.connect() as collection:
|
||||
user = await collection.find_one({"_id": user_id})
|
||||
|
||||
return User(
|
||||
id=str(user["_id"]),
|
||||
oauths=user["oauths"],
|
||||
is_admin=user["is_admin"],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
async def get_or_create_user(cls, newUser: CreateUser) -> User:
|
||||
filter_data = {}
|
||||
|
||||
Reference in New Issue
Block a user