messages.CreateChat

class pyrogram.raw.functions.messages.CreateChat

Creates a new chat.

Details:
  • Layer: 223

  • ID: 92CEDDD4

Parameters:
  • users (List of InputUser) – List of user IDs to be invited

  • title (str) – Chat name

  • ttl_period (int 32-bit, optional) – Time-to-live of all messages that will be sent in the chat: once message.date+message.ttl_period === time(), the message will be deleted on the server, and must be deleted locally as well. You can use messages.setDefaultHistoryTTL to edit this value later.

Returns:

messages.InvitedUsers

TL Schema

messages.createChat#92ceddd4
flags:#
users:Vector<InputUser>
title:string
ttl_period:flags.0?int

= messages.InvitedUsers

Parameter Tree

CreateChat
├── usersVector < InputUser >
│ ├── InputUserEmpty
│ ├── InputUserSelf
│ ├── InputUser
│ │ ├── user_idlong
│ │ └── access_hashlong
│ └── InputUserFromMessage
│ ├── peerInputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_idint
│ └── user_idlong
├── titlestring
└── ttl_periodint (optional)

Example

await app.invoke(
    CreateChat(
        users=[
                await app.resolve_user(chat_id)
            ],
        title="text",
        ttl_period=0,
    )
)