Skip to main content

channels.deleteParticipantHistory

Delete all messages sent by a specific participant of a given supergroup

func (c *Client) ChannelsDeleteParticipantHistory(ctx context.Context, request *ChannelsDeleteParticipantHistoryRequest) (*MessagesAffectedHistory, error)

Calling this method

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

res, err := api.ChannelsDeleteParticipantHistory(ctx, &tg.ChannelsDeleteParticipantHistoryRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *MessagesAffectedHistory
return nil
})

Parameters

NameTypeRequiredDescription
ChannelInputChannelClassyesSupergroup
ParticipantInputPeerClassyesThe participant whose messages should be deleted

Returns

*MessagesAffectedHistory

Possible errors

CodeTypeDescription
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.
403CHAT_WRITE_FORBIDDENYou can't write in this chat.
400MSG_ID_INVALIDInvalid message ID provided.
400PARTICIPANT_ID_INVALIDThe specified participant ID is invalid.

References