Keyword Args: module_id (str): Unique ID of the module. channel_emoji (str): Emoji of the channel, empty string if the chat is from a middleware. module_name: Name of the module. name (str): Name of the chat. alias
(self, *, channel: Optional[SlaveChannel] = None, middleware: Optional[Middleware] = None,
module_name: str = "", channel_emoji: str = "", module_id: ModuleID = ModuleID(""),
name: str = "", alias: Optional[str] = None, id: ChatID = ChatID(""),
uid: ChatID = ChatID(""),
vendor_specific: Dict[str, Any] = None, description: str = "",
members: MutableSequence[ChatMember] = None,
notification: ChatNotificationState = ChatNotificationState.ALL,
with_self: bool = True)
| 445 | """The user as a member of the chat (if available).""" |
| 446 | |
| 447 | def __init__(self, *, channel: Optional[SlaveChannel] = None, middleware: Optional[Middleware] = None, |
| 448 | module_name: str = "", channel_emoji: str = "", module_id: ModuleID = ModuleID(""), |
| 449 | name: str = "", alias: Optional[str] = None, id: ChatID = ChatID(""), |
| 450 | uid: ChatID = ChatID(""), |
| 451 | vendor_specific: Dict[str, Any] = None, description: str = "", |
| 452 | members: MutableSequence[ChatMember] = None, |
| 453 | notification: ChatNotificationState = ChatNotificationState.ALL, |
| 454 | with_self: bool = True): |
| 455 | """ |
| 456 | Keyword Args: |
| 457 | module_id (str): Unique ID of the module. |
| 458 | channel_emoji (str): Emoji of the channel, empty string if the chat |
| 459 | is from a middleware. |
| 460 | module_name: Name of the module. |
| 461 | name (str): Name of the chat. |
| 462 | alias (Optional[str]): Alternative name of the chat, usually set by user. |
| 463 | id: Unique ID of the chat. This MUST be unique within the channel. |
| 464 | description (str): |
| 465 | A text description of the chat, usually known as “bio”, |
| 466 | “description”, “purpose”, or “topic” of the chat. |
| 467 | notification (ChatNotificationState): Indicate the notification settings of the chat in |
| 468 | its slave channel (or middleware), defaulted to ``ALL``. |
| 469 | members (MutableSequence[:obj:`.ChatMember`]): Provide a list of members of the chat. |
| 470 | Defaulted to an empty :obj:`list`. |
| 471 | vendor_specific (Dict[str, Any]): Any vendor specific attributes. |
| 472 | with_self (bool): Initialize the chat with the User Themself as a member. |
| 473 | """ |
| 474 | super().__init__(channel=channel, middleware=middleware, module_name=module_name, channel_emoji=channel_emoji, |
| 475 | module_id=module_id, name=name, alias=alias, id=id, uid=uid, |
| 476 | vendor_specific=vendor_specific, description=description) |
| 477 | self.members: MutableSequence[ChatMember] = members if members is not None else [] |
| 478 | if with_self: |
| 479 | self.self = self.add_self() |
| 480 | else: |
| 481 | self.self = None |
| 482 | self.notification: ChatNotificationState = notification |
| 483 | |
| 484 | @property |
| 485 | def has_self(self) -> bool: |