Add get_user method

This commit is contained in:
LoRiot 2022-10-16 17:06:45 +03:00
parent 4730fb646b
commit 474efbf43f
1 changed files with 5 additions and 0 deletions

View File

@ -13,3 +13,8 @@ class Repo:
"VALUES ($1, $2) ON CONFLICT (user_id) DO NOTHING",
user_id, chat_id
)
async def get_user(self, user_id: int):
return await self.conn.fetchval(
"SELECT user_id FROM users WHERE user_id = $1", user_id
)