Skip to main content

channels.deleteHistory

Delete the history of a supergroup

func (c *Client) ChannelsDeleteHistory(ctx context.Context, request *ChannelsDeleteHistoryRequest) (UpdatesClass, error)

Calling this method​

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

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

Parameters​

NameTypeRequiredDescription
ForEveryonebool—Whether the history should be deleted for everyone
ChannelInputChannelClassyesSupergroup whose history must be deleted
MaxIDintyesID of message up to which the history must be deleted

Returns​

UpdatesClass

Possible errors​

CodeTypeDescription
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_PARICIPANT_MISSINGThe current user is not in the channel.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400CHANNEL_TOO_BIGThis channel has too many participants (>1000) to be deleted.
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.

References​