INNER CODE UNIT · Python

update_message

browser-use/bux · agent/agency_db.py:166

def update_message(db: sqlite3.Connection, suggestion_id: int, message_id: int) -> None:
    db.execute(
        "UPDATE suggestions SET tg_message_id = ?, updated_at = ? WHERE id = ?",
        (message_id, _now(), suggestion_id),
    )
    db.commit()


def find_by_message(
    db: sqlite3.Connection, chat_id: int, message_id: int
) -> dict[str, Any] | None:
    """Return the suggestion row as a plain dict (or None if not found).

    Returning a dict (not the raw sqlite3.Row) lets callers use .get() and
    other dict APIs without surprises — sqlite3.Row supports indexed access
    but not the dict protocol's .get() method.
    """
    cur = db.execute(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…