Skip to content

Admin Permissions

Amarnath C edited this page Oct 21, 2022 · 1 revision

Giving or revoking admin permissions can be done with the following code:

# Give admin permissions to user in chat/channel
client.EditAdmin(channel, who, &telegram.AdminOptions{IsAdmin: true})

# Revoke admin to user in chat/channel
client.EditAdmin(channel, who, &telegram.AdminOptions{IsAdmin: false})

Note that you can also deny/allow specific permissions for an admin using the Adminoption argument of EditAdmin. More about this method and the arguments it takes here.

Clone this wiki locally