telegram.user module

This module contains an object that represents a Telegram User.

class telegram.user.User(id, first_name, type=None, last_name=None, username=None, language_code=None, bot=None, **kwargs)

Bases: telegram.base.TelegramObject

This object represents a Telegram User.

id

int – Unique identifier for this user or bot

first_name

str – User’s or bot’s first name

last_name

str – User’s or bot’s last name

username

str – User’s or bot’s username

language_code

str – IETF language tag of the user’s language

type

str – Deprecated

Parameters:
  • id (int) – Unique identifier for this user or bot
  • first_name (str) – User’s or bot’s first name
  • **kwargs – Arbitrary keyword arguments.
Keyword Arguments:
 
  • type (Optional[str]) – Deprecated
  • last_name (Optional[str]) – User’s or bot’s last name
  • username (Optional[str]) – User’s or bot’s username
  • language_code (Optional[str]) – IETF language tag of the user’s language
  • bot (Optional[Bot]) – The Bot to use for instance methods
static de_json(data, bot)
Parameters:
Returns:

Return type:

telegram.User

static de_list(data, bot)
Parameters:
Returns:

Return type:

List<telegram.User>

get_profile_photos(*args, **kwargs)

Shortcut for bot.getUserProfilePhotos(update.message.from_user.id, *args, **kwargs)

name

str