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

Class BusinessConnection

src/telegram/_business.py:192–281  ·  view source on GitHub ↗

Describes the connection of the bot with a business account. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal if their :attr:`id`, :attr:`user`, :attr:`user_chat_id`, :attr:`date`, :attr:`rights`, and :attr:`is_enabled` are e

Source from the content-addressed store, hash-verified

190
191
192class BusinessConnection(TelegramObject):
193 """
194 Describes the connection of the bot with a business account.
195
196 Objects of this class are comparable in terms of equality. Two objects of this class are
197 considered equal if their :attr:`id`, :attr:`user`, :attr:`user_chat_id`, :attr:`date`,
198 :attr:`rights`, and :attr:`is_enabled` are equal.
199
200 .. versionadded:: 21.1
201 .. versionchanged:: 22.1
202 Equality comparison now considers :attr:`rights` instead of ``can_reply``.
203
204 .. versionremoved:: 22.3
205 Removed argument and attribute ``can_reply`` deprecated by API 9.0.
206
207 Args:
208 id (:obj:`str`): Unique identifier of the business connection.
209 user (:class:`telegram.User`): Business account user that created the business connection.
210 user_chat_id (:obj:`int`): Identifier of a private chat with the user who created the
211 business connection.
212 date (:obj:`datetime.datetime`): Date the connection was established in Unix time.
213 is_enabled (:obj:`bool`): True, if the connection is active.
214 rights (:class:`BusinessBotRights`, optional): Rights of the business bot.
215
216 .. versionadded:: 22.1
217
218 Attributes:
219 id (:obj:`str`): Unique identifier of the business connection.
220 user (:class:`telegram.User`): Business account user that created the business connection.
221 user_chat_id (:obj:`int`): Identifier of a private chat with the user who created the
222 business connection.
223 date (:obj:`datetime.datetime`): Date the connection was established in Unix time.
224 is_enabled (:obj:`bool`): True, if the connection is active.
225 rights (:class:`BusinessBotRights`): Optional. Rights of the business bot.
226
227 .. versionadded:: 22.1
228 """
229
230 __slots__ = (
231 "date",
232 "id",
233 "is_enabled",
234 "rights",
235 "user",
236 "user_chat_id",
237 )
238
239 def __init__(
240 self,
241 id: str,
242 user: "User",
243 user_chat_id: int,
244 date: dtm.datetime,
245 is_enabled: bool,
246 rights: BusinessBotRights | None = None,
247 *,
248 api_kwargs: JSONDict | None = None,
249 ):

Callers 6

test_update.pyFile · 0.90
business_connectionFunction · 0.90
test_equalityMethod · 0.90
dummy_objects.pyFile · 0.90
business_connectionFunction · 0.90

Calls

no outgoing calls

Tested by 4

business_connectionFunction · 0.72
test_equalityMethod · 0.72
business_connectionFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…