Skip to main content
This section covers administrative and management methods for Chats and Members in the Telegram Bot API.

Member Management

banChatMember

Use this method to ban a user in a group, a supergroup or a channel.
BLP Example

unbanChatMember

Use this method to unban a previously banned user in a supergroup or channel.
BLP Example

restrictChatMember

Use this method to restrict a user in a supergroup.
BLP Example

promoteChatMember

Use this method to promote or demote a user in a supergroup or a channel.
BLP Example

setChatAdministratorCustomTitle

Use this method to set a custom title for an administrator in a supergroup promoted by the bot.
BLP Example

banChatSenderChat

Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won’t be able to send messages on behalf of any of their channels.
BLP Example

unbanChatSenderChat

Use this method to unban a previously banned channel chat in a supergroup or channel.
BLP Example

Chat Management

setChatPermissions

Use this method to set default chat permissions for all members.
BLP Example
Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked.
BLP Example
Use this method to create an additional invite link for a chat.
BLP Example
Use this method to edit a non-primary invite link created by the bot.
BLP Example
Use this method to revoke an invite link created by the bot.
BLP Example

approveChatJoinRequest

Use this method to approve a chat join request.
BLP Example

declineChatJoinRequest

Use this method to decline a chat join request.
BLP Example

setChatPhoto

Use this method to set a new profile photo for the chat.
BLP Example

deleteChatPhoto

Use this method to delete a chat photo.
BLP Example

setChatTitle

Use this method to change the title of a chat.
BLP Example

setChatDescription

Use this method to change the description of a group, a supergroup or a channel.
BLP Example

pinChatMessage

Use this method to add a message to the list of pinned messages in a chat.
BLP Example

unpinChatMessage

Use this method to remove a message from the list of pinned messages in a chat.
BLP Example

unpinAllChatMessages

Use this method to clear the list of pinned messages in a chat.
BLP Example

leaveChat

Use this method for your bot to leave a group, supergroup or channel.
BLP Example

Chat Information Retrievals

getChat

Use this method to get up to date information about the chat.
BLP Example

getChatAdministrators

Use this method to get a list of administrators in a chat.
BLP Example

getChatMemberCount

Use this method to get the number of members in a chat.
BLP Example

getChatMember

Use this method to get information about a member of a chat.
BLP Example