telegram api method · layer 229 · #92ceddd4
messages.createChat
Creates a new chat.
definition
messages.createChat#92ceddd4 flags:# users:Vector<InputUser> title:string ttl_period:flags.0?int = messages.InvitedUsers;
parameters
| name | type | description |
|---|---|---|
flags | # | Flags, see TL conditional fields |
users | Vector<InputUser> | List of user IDs to be invited |
title | string | Chat name |
ttl_period | int | 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
errors (11)
| code | error | description |
|---|---|---|
| 400 | BUSINESS_CONNECTION_NOT_ALLOWED | This method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we're a user, and users cannot invoke methods over a business connection; (2) we're a bot, but business mode was disabled in @botfather or (3); we're a bot, but this method cannot be invoked over a business connection. |
| 400 | CHAT_INVALID | Invalid chat. |
| 400 | CHAT_MEMBER_ADD_FAILED | Could not add participants. |
| 400 | CHAT_TITLE_EMPTY | No chat title provided. |
| 400 | INPUT_USER_DEACTIVATED | The specified user was deleted. |
| 400 | TTL_PERIOD_INVALID | The specified TTL period is invalid. |
| 400 | USERS_TOO_FEW | Not enough users (to create a chat, for example). |
| 401 | AUTH_KEY_UNREGISTERED | The specified authorization key is not registered in the system (for example, a PFS temporary key has expired). |
| 403 | USER_RESTRICTED | You're spamreported, you can't create channels or chats. |
| 406 | USER_RESTRICTED | You're spamreported, you can't create channels or chats. |
| 500 | CHAT_ID_GENERATE_FAILED | Failure while generating the chat ID. |
history
present in layers 2–229 · constructor id changed 3×
| id | layers |
|---|---|
| #419d9aee | 2–23 |
| #09cb126e | 46–149 |
| #0034a818 | 150–176 |
| #92ceddd4 | 177–229 |