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
| Name | Type | Required | Description |
|---|---|---|---|
ForEveryone | bool | — | Whether the history should be deleted for everyone |
Channel | InputChannelClass | yes | Supergroup whose history must be deleted |
MaxID | int | yes | ID of message up to which the history must be deleted |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CHANNEL_INVALID | The provided channel is invalid. |
| 400 | CHANNEL_PARICIPANT_MISSING | The current user is not in the channel. |
| 400 | CHANNEL_PRIVATE | You haven't joined this channel/supergroup. |
| 400 | CHANNEL_TOO_BIG | This channel has too many participants (>1000) to be deleted. |
| 400 | CHAT_ADMIN_REQUIRED | You must be an admin in this chat to do this. |
References
- Official documentation
- Generated Go reference
- TL definition:
channels.deleteHistory#9baa9647