messages.editChatAdmin
Make a user admin in a basic group.
func (c *Client) MessagesEditChatAdmin(ctx context.Context, request *MessagesEditChatAdminRequest) (bool, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.MessagesEditChatAdmin(ctx, &tg.MessagesEditChatAdminRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
ChatID | int64 | yes | The ID of the group |
UserID | InputUserClass | yes | The user to make admin |
IsAdmin | bool | yes | Whether to make them admin |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CHAT_ID_INVALID | The provided chat id is invalid. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
| 400 | USER_ID_INVALID | The provided user ID is invalid. |
| 400 | USER_NOT_PARTICIPANT | You're not a member of this supergroup/channel. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.editChatAdmin#a85bd1c2