telegram api method · layer 229 · #cbc6d107

messages.addChatUser

usable by users

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

definition

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

returns

messages.InvitedUsers

errors (20)

codeerrordescription
400BOT_GROUPS_BLOCKEDThis bot can't be added to groups.
400BUSINESS_CONNECTION_NOT_ALLOWEDThis 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.
400CHAT_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.
400INPUT_USER_DEACTIVATEDThe specified user was deleted.
400MSG_ID_INVALIDInvalid message ID provided.
400PEER_ID_INVALIDThe provided peer id is invalid.
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.
400USER_NOT_MUTUAL_CONTACTThe provided user is not a mutual contact.
400USERS_TOO_MUCHThe maximum number of users has been exceeded (to create a chat, for example).
400YOU_BLOCKED_USERYou blocked this user.
401AUTH_KEY_UNREGISTEREDThe specified authorization key is not registered in the system (for example, a PFS temporary key has expired).
403CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
403CHAT_WRITE_FORBIDDENYou can't write in this chat.
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.

history

present in layers 2–229 · constructor id changed 3×

idlayers
#2ee9ee9e2–23
#f9a0aa0946–132
#f24753e3133–176
#cbc6d107177–229