Skip to content

ExtendedUser

Extended user object with backwards compatibility

Extended user object with backwards compatibility

class ExtendedUser(User)
  • unique_id (property, Optional[str]) — Legacy alias for the @-handle. v3 exposes it as display_id.
  • is_friend (property, bool) — Is the user friends with the streamer
  • get_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 stream
  • is_top_gifter (property, bool) — Is the user a top gifter in the stream
  • member_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.

Convert a user to an ExtendedUser object

@classmethod
def from_user(user: User) -> ExtendedUser
  • user (User) — Original user object

ExtendedUser — ExtendedUser instance

Check if the user has a specific badge type with optional level validation.

def has_badge(badge_type: str, level: Optional[str | int] = None) -> bool
  • badge_type (str) — Badge type to check (e.g., “SUBSCRIBER”).
  • level (Optional[str | int], default None) — Optional level to validate.

bool — True if the badge exists with matching criteria, False otherwise.

from TikTokLive.proto import ExtendedUser

TikTokLive/proto/custom_proto.py:42