How to delete all conversations

Hello. How to delete all this?

write exact instructions please

One way to delete a conversation is to delete them in the database.

From SQLite

sqlite3 data/storage/core.sqlite
.tables
delete from msg_messages;

Where did you can get your screenshot :sweat_smile:? Are you in a specific module or loaded a specific module? Because the upper command might not work. A module can create an extra table in the database. Are you using SQLite or postgresql database ? Are you using docker?

in my webchat

no, what module are you talking about?

I using sqlite database. and no I’m not using docker.

I don’t have table msg_messages;

how to remove all conversations in code? I don’t need to store them

Hie @ulizhak thanks for your patience. Which version of Botpress are you using? Where is your installation hosted? And confirm, you want to delete the messages appearing in the emulator?

Hello, my botpress version is 12.22.2. My instalation hosted on my personal server. I want to have an ability to delete an old conversations (not messages) of all users as a developer. It’s not in the emulator/ I have conversation button enabled in my bot. I don’t need to store all this conversations.
I saw this topic with similar question and solution Delete or hide messages but I can’t understand in which file I can insert this code? Is it suitable for my problem?

Hello Michael. Any help?

Will anyone answer me or not?

I did load the versions 12.22.2, In the SQLite database, I got the following tables.

sqlite> .table
bot_analytics           nlu_training_queue      strategy_default
bot_chat_users          srv_channel_users       tasks
conversations           srv_ghost_files         telemetry
data_retention          srv_ghost_index         web_conversations
dialog_sessions         srv_kvs                 web_messages
events                  srv_logs                workspace_invite_codes
mapping                 srv_metadata            workspace_users
messages                srv_migrations

From the thread you post earlier. This person is deleting the web_conversations tables.

What are the tables you have in your SQLite database?

This command will delete all the web_conversations.

delete from web_conversations;

I still didn’t find where you got your screenshot. If you have time, could you describe the step you have done to arrive at this screenshot? I want to see what are the calls that are being made to the backend.

Thanks agaain.

Set showConversationsButton: true and you will see a new butoon in your webchat. With all your previous conversations.

I don’t need to remove it with query. I need to remove it with some hook or another way, maybe by schedule. How can i do it?

CronJob

If you want to schedule some things you can use cronjob.

I was able to reproduce what you want. If you want to delete all the conversations. You could use this cronjob schedule to delete the conversations

crontab -e 
0 1 * * * sqlite3 /path_to_your_database/core.sqlite "delete from msg_conversations;"

Custom-module

You could create a custom module to delete the msg_conversations.