create a new group chat object. Chats are unpromoted until the first message is sent. :param contacts: list of contacts to add :returns: a :class:`deltachat.chat.Chat` object.
(
self,
name: str,
contacts: Optional[List[Contact]] = None,
)
| 401 | return self.create_contact(obj).create_chat() |
| 402 | |
| 403 | def create_group_chat( |
| 404 | self, |
| 405 | name: str, |
| 406 | contacts: Optional[List[Contact]] = None, |
| 407 | ) -> Chat: |
| 408 | """create a new group chat object. |
| 409 | |
| 410 | Chats are unpromoted until the first message is sent. |
| 411 | |
| 412 | :param contacts: list of contacts to add |
| 413 | :returns: a :class:`deltachat.chat.Chat` object. |
| 414 | """ |
| 415 | bytes_name = name.encode("utf8") |
| 416 | chat_id = lib.dc_create_group_chat(self._dc_context, 0, bytes_name) |
| 417 | chat = Chat(self, chat_id) |
| 418 | if contacts is not None: |
| 419 | for contact in contacts: |
| 420 | chat.add_contact(contact) |
| 421 | return chat |
| 422 | |
| 423 | def get_chats(self) -> List[Chat]: |
| 424 | """return list of chats. |