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)
| 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. |