Delete Multiple Chat

I want to delete multiple messages of a sender at a time. Is there any method to do so. I can delete only one message at a time but to achieve multiple deletion I have gone with for loop in that the first item of the list is deleting. When it comes to the second item it gives me an error. So kindly provide me some mechanism to achieve this.

Hi @Gurjeet_Singh_Khalsa , sorry for the late response.
As you said, we have the only method that deletes a message at a time. So you should call it multiple times. You are doing it in the right way.
Could you give me what error code comes? And does it happen all the time?