tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

How to delete local chat history? #2717

Closed chenyu1990 closed 8 months ago

chenyu1990 commented 10 months ago

like this how-to-delete-local-history

levlam commented 10 months ago

Use deleteChatHistory.

chenyu1990 commented 10 months ago

Deletes all messages in the chat. Use chat.can_be_deleted_only_for_self and chat.can_be_deleted_for_all_users fields to find whether and how the method can be applied to the chat
It seems that permission is required.
And it’s not an offline request

levlam commented 10 months ago

It is exactly the method behind the "Clear history" menu option.

chenyu1990 commented 10 months ago

okay, thanks.

Fahmedo commented 10 months ago

Hi @levlam can you assign this task to me so I can update the documentation file with the method to be used in order to clear all chat history from locale history.

levlam commented 10 months ago

What do you mean?

Godswil-Uche commented 10 months ago

The Option in the Chat History Menu can solve this.

Fahmedo commented 10 months ago

I guess it would be great to update the documentation to include instructions on how to delete local chat history and also provide step-by-step instructions on how to perform the deletion

chenyu1990 commented 10 months ago

It is exactly the method behind the "Clear history" menu option.

it's not work... got error: 400 Can't delete history of chat -1001487844290 only for self

levlam commented 10 months ago

This means that you can't clear history of the chat in any app: "use chat.can_be_deleted_only_for_self and chat.can_be_deleted_for_all_users fields to find whether and how the method can be applied to the chat."

chenyu1990 commented 10 months ago

This means that you can't clear history of the chat in any app: "use chat.can_be_deleted_only_for_self and chat.can_be_deleted_for_all_users fields to find whether and how the method can be applied to the chat."

so. How to use this feature with supergroup? deleteChatHistory can't do it. how-to-delete-local-history

levlam commented 10 months ago

It is impossible to delete history in non-owned public supergroups.