Skip to main content

messages.editChatDefaultBannedRights

Edit the default banned rights of a channel/supergroup/group.

func (c *Client) MessagesEditChatDefaultBannedRights(ctx context.Context, request *MessagesEditChatDefaultBannedRightsRequest) (UpdatesClass, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.MessagesEditChatDefaultBannedRights(ctx, &tg.MessagesEditChatDefaultBannedRightsRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})

Parameters

NameTypeRequiredDescription
PeerInputPeerClassyesThe peer
BannedRightsChatBannedRightsyesThe new global rights

Returns

UpdatesClass

Possible errors

CodeTypeDescription
400BANNED_RIGHTS_INVALIDYou provided some invalid flags in the banned rights.
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400CHAT_ID_INVALIDThe provided chat id is invalid.
400CHAT_NOT_MODIFIEDNo changes were made to chat information because the new information you passed is identical to the current information.
403CHAT_WRITE_FORBIDDENYou can't write in this chat.
400PEER_ID_INVALIDThe provided peer id is invalid.
400UNTIL_DATE_INVALIDInvalid until date provided.

References