messages.createChat #

Creates a new chat.

Layer 223

messages.invitedUsers#7f5defa6 updates:Updates missing_invitees:Vector<MissingInvitee> = messages.InvitedUsers;
---functions---
messages.createChat#92ceddd4 flags:# users:Vector<InputUser> title:string ttl_period:flags.0?int = messages.InvitedUsers;

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
usersVector<InputUser>List of user IDs to be invited
titlestringChat name
ttl_periodflags.0?intTime-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.

Result #

messages.InvitedUsers

Only users can use this method #

Possible errors #

CodeTypeDescription
500CHAT_ID_GENERATE_FAILEDFailure while generating the chat ID.
400CHAT_INVALIDInvalid chat.
400CHAT_MEMBER_ADD_FAILEDCould not add participants.
400CHAT_TITLE_EMPTYNo chat title provided.
400INPUT_USER_DEACTIVATEDThe specified user was deleted.
400TTL_PERIOD_INVALIDThe specified TTL period is invalid.
400USERS_TOO_FEWNot enough users (to create a chat, for example).
406USER_RESTRICTEDYou're spamreported, you can't create channels or chats.

messages.setDefaultHistoryTTL #

Changes the default value of the Time-To-Live setting, applied to all new chats.