-
Notifications
You must be signed in to change notification settings - Fork 21
setChatMemberStatus
Changes the status of a chat member, needs appropriate privileges.
This function is currently not suitable for adding new members to the chat; instead, use addChatMember.
The chat member status will not be changed until it has been synchronized with the server.
setChatMemberStatus(chat_id, user_id, status, right, callback, data)
Field | Type | Description |
---|---|---|
chat_id |
int53 | Chat identifier. |
user_id |
int32 | User identifier. |
status |
string | The new status of the member in the chat. |
-
Creator
The user is the creator of a chat and has all the administrator privileges.
-
Administrator
The user is a member of a chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, and ban unprivileged members. In supergroups and channels, there are more detailed options for administrator privileges.
Administrator rights is written in these following form:
{can_be_edited, can_change_info, can_post_messages, can_edit_messages, can_delete_messages, can_invite_users, can_restrict_members, can_pin_messages, can_promote_members}
Right Type Description can_be_edited
Bool True, if the current user can edit the administrator privileges for the called user. can_change_info
Bool True, if the administrator can change the chat title, photo, and other settings. can_post_messages
Bool True, if the administrator can create channel posts; applicable to channels only. can_edit_messages
Bool True, if the administrator can edit messages of other users and pin messages; applicable to channels only. can_delete_messages
Bool True, if the administrator can delete messages of other users. can_invite_users
Bool True, if the administrator can invite new users to the chat. can_restrict_members
Bool True, if the administrator can restrict, ban, or unban chat members. can_pin_messages
Bool True, if the administrator can pin messages; applicable to supergroups only. can_promote_members
Bool True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that were directly or indirectly promoted by him. -
Member
The user is a member of a chat, without any additional privileges or restrictions.
-
Restricted
The user is under certain restrictions in the chat. Not supported in basic groups and channels.
Restricted user restriction is written in these following form:
{is_member, restricted_until_date, can_send_messages, can_send_media_messages, can_send_other_messages, can_add_web_page_previews}
Restriction Type Description is_member
Bool True, if the user is a member of the chat. restricted_until_date
int32 Point in time (Unix timestamp) when restrictions will be lifted from the user; 0 if never. If the user is restricted for more than 366 days or for less than 30 seconds from the current time, the user is considered to be restricted forever. can_send_messages
Bool True, if the user can send text messages, contacts, locations, and venues. can_send_media_messages
Bool True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions. can_send_other_messages
Bool True, if the user can send animations, games, and stickers and use inline bots. Implies can_send_media_messages permissions. can_add_web_page_previews
Bool True, if the user may add a web page preview to his messages. Implies can_send_messages permissions. -
Left
The user is not a chat member.
-
Banned
The user was banned (and hence is not a member of the chat). Implies the user can't return to the chat or view messages.
Banned user restriction is written in these following form:
{banned_until_date}
Restriction Type Description banned_until_date
int32 Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever
-
133780085
is creator of the chat1234567890
.setChatMemberStatus(1234567890, 133780085, 'Creator', '{1}')
-
Promote user
133780085
as an administrator of chat1234567890
and given all administrator rights, except promoting another member to be an administrator.setChatMemberStatus(1234567890, 133780085, 'Administrator', '{1,1,1,1,1,1,1,1,0}')
-
User
133780085
join a chat by chat's id.setChatMemberStatus(1234567890, 133780085, 'Member')
-
User
133780085
is leaving chat1234567890
.setChatMemberStatus(1234567890, 133780085, 'Left')
-
Kick and banned user
133780085
from chat1234567890
.setChatMemberStatus(1234567890, 133780085, 'Kicked', '{0}')
Frequently Asked Questions
The Functions
- getAuthorizationState
- setTdlibParameters
- checkDatabaseEncryptionKey
- setAuthenticationPhoneNumber
- resendAuthenticationCode
- checkAuthenticationCode
- checkAuthenticationPassword
- requestAuthenticationPasswordRecovery
- recoverAuthenticationPassword
- checkAuthenticationBotToken
- logOut
- close
- destroy
- setDatabaseEncryptionKey
- getPasswordState
- setPassword
- getRecoveryEmailAddress
- setRecoveryEmailAddress
- requestPasswordRecovery
- recoverPassword
- createTemporaryPassword
- getTemporaryPasswordState
- processDcUpdate
- getMe
- getUser
- getUserFullInfo
- getBasicGroup
- getBasicGroupFullInfo
- getSupergroup
- getSupergroupFullInfo
- getSecretChat
- getChat
- getMessage
- getRepliedMessage
- getChatPinnedMessage
- getMessages
- getFile
- getRemoteFile
- getChats
- searchPublicChat
- searchPublicChats
- searchChats
- searchChatsOnServer
- getTopChats
- removeTopChat
- addRecentlyFoundChat
- removeRecentlyFoundChat
- clearRecentlyFoundChats
- checkChatUsername
- getCreatedPublicChats
- getGroupsInCommon
- getChatHistory
- deleteChatHistory
- searchChatMessages
- searchMessages
- searchSecretMessages
- searchCallMessages
- searchChatRecentLocationMessages
- getActiveLiveLocationMessages
- getChatMessageByDate
- getPublicMessageLink
- sendMessage
- sendMessageAlbum
- sendBotStartMessage
- sendInlineQueryResultMessage
- forwardMessages
- sendChatSetTtlMessage
- sendChatScreenshotTakenNotification
- deleteMessages
- deleteChatMessagesFromUser
- editMessageText
- editMessageLiveLocation
- editMessageCaption
- editMessageReplyMarkup
- editInlineMessageText
- editInlineMessageLiveLocation
- editInlineMessageCaption
- editInlineMessageReplyMarkup
- getTextEntities
- parseTextEntities
- getFileMimeType
- getFileExtension
- getInlineQueryResults
- answerInlineQuery
- getCallbackQueryAnswer
- answerCallbackQuery
- answerShippingQuery
- answerPreCheckoutQuery
- setGameScore
- setInlineGameScore
- getGameHighScores
- getInlineGameHighScores
- deleteChatReplyMarkup
- sendChatAction
- openChat
- closeChat
- viewMessages
- openMessageContent
- readAllChatMentions
- createPrivateChat
- createBasicGroupChat
- createSupergroupChat
- createSecretChat
- createNewBasicGroupChat
- createNewSupergroupChat
- createNewSecretChat
- upgradeBasicGroupChatToSupergroupChat
- setChatTitle
- setChatPhoto
- setChatDraftMessage
- toggleChatIsPinned
- setChatClientData
- addChatMember
- addChatMembers
- setChatMemberStatus
- getChatMember
- searchChatMembers
- getChatAdministrators
- setPinnedChats
- downloadFile
- cancelDownloadFile
- uploadFile
- cancelUploadFile
- setFileGenerationProgress
- finishFileGeneration
- deleteFile
- generateChatInviteLink
- checkChatInviteLink
- joinChatByInviteLink
- createCall
- acceptCall
- discardCall
- sendCallRating
- sendCallDebugInformation
- blockUser
- unblockUser
- getBlockedUsers
- importContacts
- searchContacts
- removeContacts
- getImportedContactCount
- changeImportedContacts
- clearImportedContacts
- getUserProfilePhotos
- getStickers
- searchStickers
- getInstalledStickerSets
- getArchivedStickerSets
- getTrendingStickerSets
- getAttachedStickerSets
- getStickerSet
- searchStickerSet
- searchInstalledStickerSets
- searchStickerSets
- changeStickerSet
- viewTrendingStickerSets
- reorderInstalledStickerSets
- getRecentStickers
- addRecentSticker
- removeRecentSticker
- clearRecentStickers
- getFavoriteStickers
- addFavoriteSticker
- removeFavoriteSticker
- getStickerEmojis
- getSavedAnimations
- addSavedAnimation
- removeSavedAnimation
- getRecentInlineBots
- searchHashtags
- removeRecentHashtag
- getWebPagePreview
- getWebPageInstantView
- getNotificationSettings
- setNotificationSettings
- setNotificationSettings
- resetAllNotificationSettings
- setProfilePhoto
- deleteProfilePhoto
- setName
- setBio
- setUsername
- changePhoneNumber
- resendChangePhoneNumberCode
- checkChangePhoneNumberCode
- getActiveSessions
- terminateSession
- terminateAllOtherSessions
- getConnectedWebsites
- disconnectWebsite
- disconnectAllWebsites
- toggleBasicGroupAdministrators
- setSupergroupUsername
- setSupergroupStickerSet
- toggleSupergroupInvites
- toggleSupergroupSignMessages
- toggleSupergroupIsAllHistoryAvailable
- setSupergroupDescription
- pinSupergroupMessage
- unpinSupergroupMessage
- reportSupergroupSpam
- getSupergroupMembers
- deleteSupergroup
- closeSecretChat
- getChatEventLog
- getPaymentForm
- validateOrderInfo
- sendPaymentForm
- getPaymentReceipt
- getSavedOrderInfo
- deleteSavedOrderInfo
- deleteSavedCredentials
- getSupportUser
- getWallpapers
- registerDevice
- getRecentlyVisitedTMeUrls
- setUserPrivacySettingRules
- getUserPrivacySettingRules
- getOption
- setOption
- setAccountTtl
- getAccountTtl
- deleteAccount
- getChatReportSpamState
- changeChatReportSpamState
- reportChat
- getStorageStatistics
- getStorageStatisticsFast
- optimizeStorage
- setNetworkType
- getNetworkStatistics
- addNetworkStatistics
- resetNetworkStatistics
- setBotUpdatesStatus
- uploadStickerFile
- createNewStickerSet
- addStickerToSet
- setStickerPositionInSet
- removeStickerFromSet
- sendCustomRequest
- answerCustomQuery
- setAlarm
- getCountryCode
- getInviteText
- getTermsOfService
- setProxy
- getProxy
- testCallEmpty
- testCallString
- testCallBytes
- testCallVectorInt
- testCallVectorIntObject
- testCallVectorString
- testCallVectorStringObject
- testSquareInt
- testNetwork
- testGetDifference
- testUseUpdate
- testUseError
- sendText
- sendAnimation
- sendAudio
- sendDocument
- sendPhoto
- sendSticker
- sendVideo
- sendVideoNote
- sendVoiceNote
- sendLocation
- sendVenue
- sendContact
- sendGame
- sendInvoice
- sendForwarded