MCPcopy Index your code
hub / github.com/python-telegram-bot/python-telegram-bot / User

Class User

src/telegram/_user.py:81–3067  ·  view source on GitHub ↗

This object represents a Telegram user or bot. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`id` is equal. .. versionchanged:: 20.0 The following are now keyword-only arguments in Bot methods:

Source from the content-addressed store, hash-verified

79
80
81class User(TelegramObject):
82 """This object represents a Telegram user or bot.
83
84 Objects of this class are comparable in terms of equality. Two objects of this class are
85 considered equal, if their :attr:`id` is equal.
86
87 .. versionchanged:: 20.0
88 The following are now keyword-only arguments in Bot methods:
89 ``location``, ``filename``, ``venue``, ``contact``,
90 ``{read, write, connect, pool}_timeout`` ``api_kwargs``. Use a named argument for those,
91 and notice that some positional arguments changed position as a result.
92
93 Args:
94 id (:obj:`int`): Unique identifier for this user or bot.
95 is_bot (:obj:`bool`): :obj:`True`, if this user is a bot.
96 first_name (:obj:`str`): User's or bot's first name.
97 last_name (:obj:`str`, optional): User's or bot's last name.
98 username (:obj:`str`, optional): User's or bot's username.
99 language_code (:obj:`str`, optional): IETF language tag of the user's language.
100 can_join_groups (:obj:`str`, optional): :obj:`True`, if the bot can be invited to groups.
101 Returned only in :meth:`telegram.Bot.get_me`.
102 can_read_all_group_messages (:obj:`str`, optional): :obj:`True`, if privacy mode is
103 disabled for the bot. Returned only in :meth:`telegram.Bot.get_me`.
104 supports_inline_queries (:obj:`str`, optional): :obj:`True`, if the bot supports inline
105 queries. Returned only in :meth:`telegram.Bot.get_me`.
106
107 is_premium (:obj:`bool`, optional): :obj:`True`, if this user is a Telegram Premium user.
108
109 .. versionadded:: 20.0
110 added_to_attachment_menu (:obj:`bool`, optional): :obj:`True`, if this user added
111 the bot to the attachment menu.
112
113 .. versionadded:: 20.0
114 can_connect_to_business (:obj:`bool`, optional): :obj:`True`, if the bot can be connected
115 to a user account to manage it. Returned only in
116 :meth:`telegram.Bot.get_me`.
117
118 .. versionadded:: 21.1
119 has_main_web_app (:obj:`bool`, optional): :obj:`True`, if the bot has the main Web App.
120 Returned only in :meth:`telegram.Bot.get_me`.
121
122 .. versionadded:: 21.5
123 has_topics_enabled (:obj:`bool`, optional): :obj:`True`, if the bot has forum topic mode
124 enabled in private chats. Returned only in :meth:`telegram.Bot.get_me`.
125
126 .. versionadded:: 22.6
127 allows_users_to_create_topics (:obj:`bool`, optional): :obj:`True`, if the bot allows
128 users to create and delete topics in private chats. Returned only in
129 :meth:`telegram.Bot.get_me`.
130
131 .. versionadded:: 22.7
132 can_manage_bots (:obj:`bool`, optional): :obj:`True`, if other bots can be created to be
133 controlled by the bot. Returned only in :meth:`telegram.Bot.get_me`.
134
135 .. versionadded:: 22.8
136 supports_guest_queries (:obj:`bool`, optional): :obj:`True`, if the bot supports guest
137 queries from chats it is not a member of. Returned only in
138 :meth:`telegram.Bot.get_me`.

Callers 15

test_equalityMethod · 0.90
userFunction · 0.90
test_equalityMethod · 0.90
test_update.pyFile · 0.90
test_equalityMethod · 0.90
PollOptionTestBaseClass · 0.90
PollAnswerTestBaseClass · 0.90
test_equalityMethod · 0.90
test_equalityMethod · 0.90

Calls

no outgoing calls

Tested by 15

test_equalityMethod · 0.72
userFunction · 0.72
test_equalityMethod · 0.72
test_equalityMethod · 0.72
test_equalityMethod · 0.72
test_equalityMethod · 0.72
creatorFunction · 0.72
test_equalityMethod · 0.72
test_subscriptionMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…