MCPcopy Create free account
hub / github.com/chatmail/core / create_group_chat

Method create_group_chat

python/src/deltachat/account.py:403–421  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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.

Calls 2

add_contactMethod · 0.95
ChatClass · 0.70