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

Method add_system_member

ehforwarderbot/chat.py:567–596  ·  view source on GitHub ↗

Add a system member to the chat. Useful for slave channels and middlewares to create an author of a message from a system member when the “system” member is intended to become a member of the chat. Tip: This method does not check for duplicates. Only add

(self, name: str = "", alias: Optional[str] = None, id: ChatID = ChatID(""),
                          uid: ChatID = ChatID(""),
                          vendor_specific: Dict[str, Any] = None, description: str = "",
                          middleware: Optional[Middleware] = None)

Source from the content-addressed store, hash-verified

565 middleware=middleware)
566
567 def add_system_member(self, name: str = "", alias: Optional[str] = None, id: ChatID = ChatID(""),
568 uid: ChatID = ChatID(""),
569 vendor_specific: Dict[str, Any] = None, description: str = "",
570 middleware: Optional[Middleware] = None) -> SystemChatMember:
571 """Add a system member to the chat.
572
573 Useful for slave channels and middlewares to create an author of a message from
574 a system member when the “system” member is intended to become a member of
575 the chat.
576
577 Tip:
578 This method does not check for duplicates. Only add members with this
579 method if you are sure that they are not added yet.
580
581 Keyword Args:
582 name (str): Name of the member.
583 uid: ID of the member.
584 alias (Optional[str]): Alias of the member.
585 vendor_specific (Dict[str, Any]): Any vendor specific attributes.
586 description (str):
587 A text description of the chat, usually known as “bio”,
588 “description”, “purpose”, or “topic” of the chat.
589 middleware (Optional[:class:`.Middleware`]): Initialize this chat as a part
590 of a middleware.
591 """
592 member = self.make_system_member(name=name, alias=alias, id=id, uid=uid,
593 vendor_specific=vendor_specific, description=description,
594 middleware=middleware)
595 self.members.append(member)
596 return member
597
598 def get_member(self, member_id: ChatID) -> ChatMember:
599 """Find a member of chat by its ID.

Callers 2

test_add_system_memberFunction · 0.80
__init__Method · 0.80

Calls 1

make_system_memberMethod · 0.95

Tested by 1

test_add_system_memberFunction · 0.64