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

Class Chat

src/telegram/_chat.py:4215–4277  ·  view source on GitHub ↗

This object represents a chat. 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 * Removed the deprecated methods ``kick_member`` and ``get_members_count``.

Source from the content-addressed store, hash-verified

4213
4214
4215class Chat(_ChatBase):
4216 """This object represents a chat.
4217
4218 Objects of this class are comparable in terms of equality. Two objects of this class are
4219 considered equal, if their :attr:`id` is equal.
4220
4221 .. versionchanged:: 20.0
4222
4223 * Removed the deprecated methods ``kick_member`` and ``get_members_count``.
4224 * The following are now keyword-only arguments in Bot methods:
4225 ``location``, ``filename``, ``contact``, ``{read, write, connect, pool}_timeout``,
4226 ``api_kwargs``. Use a named argument for those,
4227 and notice that some positional arguments changed position as a result.
4228
4229 .. versionchanged:: 20.0
4230 Removed the attribute ``all_members_are_administrators``. As long as Telegram provides
4231 this field for backwards compatibility, it is available through
4232 :attr:`~telegram.TelegramObject.api_kwargs`.
4233
4234 .. versionchanged:: 21.3
4235 As per Bot API 7.3, most of the arguments and attributes of this class have now moved to
4236 :class:`telegram.ChatFullInfo`.
4237
4238 Args:
4239 id (:obj:`int`): Unique identifier for this chat.
4240 type (:obj:`str`): Type of chat, can be either :attr:`PRIVATE`, :attr:`GROUP`,
4241 :attr:`SUPERGROUP` or :attr:`CHANNEL`.
4242 title (:obj:`str`, optional): Title, for supergroups, channels and group chats.
4243 username (:obj:`str`, optional): Username, for private chats, supergroups and channels if
4244 available.
4245 first_name (:obj:`str`, optional): First name of the other party in a private chat.
4246 last_name (:obj:`str`, optional): Last name of the other party in a private chat.
4247 is_forum (:obj:`bool`, optional): :obj:`True`, if the supergroup chat is a forum
4248 (has topics_ enabled).
4249
4250 .. versionadded:: 20.0
4251 is_direct_messages (:obj:`bool`, optional): :obj:`True`, if the chat is the direct messages
4252 chat of a channel.
4253
4254 .. versionadded:: 22.4
4255
4256 Attributes:
4257 id (:obj:`int`): Unique identifier for this chat.
4258 type (:obj:`str`): Type of chat, can be either :attr:`PRIVATE`, :attr:`GROUP`,
4259 :attr:`SUPERGROUP` or :attr:`CHANNEL`.
4260 title (:obj:`str`): Optional. Title, for supergroups, channels and group chats.
4261 username (:obj:`str`): Optional. Username, for private chats, supergroups and channels if
4262 available.
4263 first_name (:obj:`str`): Optional. First name of the other party in a private chat.
4264 last_name (:obj:`str`): Optional. Last name of the other party in a private chat.
4265 is_forum (:obj:`bool`): Optional. :obj:`True`, if the supergroup chat is a forum
4266 (has topics_ enabled).
4267
4268 .. versionadded:: 20.0
4269 is_direct_messages (:obj:`bool`): Optional. :obj:`True`, if the chat is the direct messages
4270 chat of a channel.
4271
4272 .. versionadded:: 22.4

Callers 15

chatFunction · 0.90
test_enum_initMethod · 0.90
test_equalityMethod · 0.90
test_full_nameMethod · 0.90
test_effective_nameMethod · 0.90
test_mention_htmlMethod · 0.90
test_mention_markdownMethod · 0.90
test_update.pyFile · 0.90
PollOptionTestBaseClass · 0.90

Calls

no outgoing calls

Tested by 15

chatFunction · 0.72
test_enum_initMethod · 0.72
test_equalityMethod · 0.72
test_full_nameMethod · 0.72
test_effective_nameMethod · 0.72
test_mention_htmlMethod · 0.72
test_mention_markdownMethod · 0.72
test_equalityMethod · 0.72
test_equalityMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…