Add get_user method

This commit is contained in:
LoRiot 2022-10-16 17:06:45 +03:00
parent 4730fb646b
commit 474efbf43f

View file

@ -13,3 +13,8 @@ class Repo:
"VALUES ($1, $2) ON CONFLICT (user_id) DO NOTHING", "VALUES ($1, $2) ON CONFLICT (user_id) DO NOTHING",
user_id, chat_id 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
)