1
0

user.py 493 B

1234567891011
  1. async def create_user(pg, user_id):
  2. await pg.execute("INSERT INTO \"user\"(user_id) VALUES($1) ON CONFLICT DO NOTHING", user_id)
  3. async def ignore_user(pg, user_id):
  4. await pg.execute("UPDATE \"user\" SET ignore = TRUE WHERE user_id = $1", user_id)
  5. async def unignore_user(pg, user_id):
  6. await pg.execute("UPDATE \"user\" SET ignore = FALSE WHERE user_id = $1", user_id)
  7. async def is_ignored(pg, user_id):
  8. return await pg.fetchval("SELECT ignore FROM \"user\" WHERE user_id = $1", user_id)