peyk.platforms.bale.types.contact

Classes

Contact(phone_number, first_name[, ...])

Represent the Bale Bot API Contact object.

class peyk.platforms.bale.types.contact.Contact(phone_number: str, first_name: str, last_name: str | None = None, user_id: int | None = None)[source]

Bases: object

Represent the Bale Bot API Contact object.

Preserves the existing dataclass fields and parsing behavior.

phone_number: str
first_name: str
last_name: str | None = None
user_id: int | None = None
classmethod from_dict(data: dict | None) Contact | None[source]

Parse raw Bale data into Contact.

Parameters:

data (Optional[dict]) – Raw API object or None.

Returns:

Parsed object or None.

Return type:

Optional[Contact]

Raises:

KeyError – If a required raw field is missing.