import sqlite3


def get_user_score(conn: sqlite3.Connection, telegram_id: int) -> int:
    """Fetches a user's score by telegram id
    :param telegram_id: the user's telegram id
    :return: returns the current score of the user
    """

    sql = """ SELECT score FROM users WHERE telegram_id = ?"""
    cur = conn.cursor()
    cur.execute(sql, [telegram_id])
    return cur.fetchone()[0]