Extended user object with backwards compatibility
Signature
Section titled “Signature”class ExtendedUser(User)Attributes
Section titled “Attributes”unique_id(property,Optional[str]) — Legacy alias for the @-handle. v3 exposes it asdisplay_id.is_friend(property,bool) — Is the user friends with the streamerget_all_badges(property,List[Tuple[str, str]]) — Retrieve all badges with their types and levels.is_moderator(property,bool) — Is the user a moderator in the streamis_top_gifter(property,bool) — Is the user a top gifter in the streammember_level(property,Optional[int]) — What is the user’s “member level” in the stream? This is a number.member_rank(property,Optional[int]) — What is the user’s “member rank” in the stream?gifter_level(property,Optional[int]) — What is the user’s “gifter level” overall? An actual number specific to their level.
Methods
Section titled “Methods”from_user
Section titled “from_user”Convert a user to an ExtendedUser object
@classmethoddef from_user(user: User) -> ExtendedUserParameters
Section titled “Parameters”user(User) — Original user object
Returns
Section titled “Returns”ExtendedUser — ExtendedUser instance
has_badge
Section titled “has_badge”Check if the user has a specific badge type with optional level validation.
def has_badge(badge_type: str, level: Optional[str | int] = None) -> boolParameters
Section titled “Parameters”badge_type(str) — Badge type to check (e.g., “SUBSCRIBER”).level(Optional[str | int], defaultNone) — Optional level to validate.
Returns
Section titled “Returns”bool — True if the badge exists with matching criteria, False otherwise.
Import
Section titled “Import”from TikTokLive.proto import ExtendedUser