MCPcopy Create free account
hub / github.com/ehForwarderBot/ehForwarderBot / SystemChatMember

Class SystemChatMember

ehforwarderbot/chat.py:331–379  ·  view source on GitHub ↗

A system account/prompt as member of a chat. Use this chat to send messages that is not from any specific member. Middlewares are RECOMMENDED to use this member type to communicate with the User in an existing chat. Chat bots created by the users of the IM platform SHOULD NOT be cr

Source from the content-addressed store, hash-verified

329
330
331class SystemChatMember(ChatMember):
332 """A system account/prompt as member of a chat.
333
334 Use this chat to send messages that is not from any specific member.
335 Middlewares are RECOMMENDED to use this member type to communicate with
336 the User in an existing chat.
337
338 Chat bots created by the users of the IM platform SHOULD NOT be created
339 as a :class:`.SystemChatMember`, but a plain :class:`.ChatMember` instead.
340
341 :class:`.SystemChatMember`\\ s are RECOMMENDED to be created using
342 :meth:`.Chat.add_system_member` or :meth:`.Chat.make_system_member` method.
343
344 Note:
345 ``SystemChatMember`` objects are picklable, thus it is RECOMMENDED
346 to keep any object of its subclass also picklable.
347
348 Attributes:
349 SYSTEM_ID: The default ID of a :class:`.SystemChatMember`.
350 """
351
352 SYSTEM_ID = ChatID("__system__")
353
354 def __init__(self, chat: 'Chat', *,
355 name: str = "", alias: Optional[str] = None, id: ChatID = ChatID(""),
356 uid: ChatID = ChatID(""),
357 vendor_specific: Dict[str, Any] = None, description: str = "",
358 middleware: Optional[Middleware] = None):
359 """
360 Args:
361 chat (:class:`~.chat.Chat`): Chat associated with this member.
362
363 Keyword Args:
364 name (str): Name of the member.
365 alias (Optional[str]): Alternative name of the member, usually set by user.
366 uid (:obj:`.ChatID` (str)):
367 Unique ID of the member. This MUST be unique within the channel.
368 This ID can be the same with a private chat of the same person.
369 description (str):
370 A text description of the member, usually known as “bio”,
371 “description”, “summary” or “introduction” of the member.
372 middleware (:class:`.Middleware`): Initialize this chat as a part
373 of a middleware.
374 """
375 name = name or translator.gettext("System")
376 uid = uid or id or self.SYSTEM_ID
377 super().__init__(chat, name=name, alias=alias, id=id, uid=uid,
378 vendor_specific=vendor_specific, description=description,
379 middleware=middleware)
380
381
382class Chat(BaseChat, ABC): # lgtm [py/missing-equals]

Callers 1

make_system_memberMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected