messages.addChatUser #

Adds a user to a chat and sends a service message on it.

Layer 223

messages.invitedUsers#7f5defa6 updates:Updates missing_invitees:Vector<MissingInvitee> = messages.InvitedUsers;
---functions---
messages.addChatUser#cbc6d107 chat_id:long user_id:InputUser fwd_limit:int = messages.InvitedUsers;

Parameters #

NameTypeDescription
chat_idlongChat ID
user_idInputUserUser ID to be added
fwd_limitintNumber of last messages to be forwarded

Result #

messages.InvitedUsers

Only users can use this method #

Possible errors #

CodeTypeDescription
400BOT_GROUPS_BLOCKEDThis bot can't be added to groups.
403CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400CHAT_ID_INVALIDThe provided chat id is invalid.
400CHAT_INVALIDInvalid chat.
400CHAT_MEMBER_ADD_FAILEDCould not add participants.
403CHAT_WRITE_FORBIDDENYou can't write in this chat.
400INPUT_USER_DEACTIVATEDThe specified user was deleted.
400MSG_ID_INVALIDInvalid message ID provided.
400PEER_ID_INVALIDThe provided peer id is invalid.
400USERS_TOO_MUCHThe maximum number of users has been exceeded (to create a chat, for example).
400USER_ALREADY_PARTICIPANTThe user is already in the group.
400USER_ID_INVALIDThe provided user ID is invalid.
400USER_IS_BLOCKEDYou were blocked by this user.
403USER_NOT_MUTUAL_CONTACTThe provided user is not a mutual contact.
403USER_PRIVACY_RESTRICTEDThe user's privacy settings do not allow you to do this.
400YOU_BLOCKED_USERYou blocked this user.