Pier Giorgio Misley
Pier Giorgio Misley

Reputation: 5351

Telegram-bot data storage

I'm developing a telegram bot which needs to store datas for each user. Is there a way to store them directly into the phone or something particular or the only way is to save them server-side and call them back for every call?

Thanks

Upvotes: 9

Views: 15314

Answers (2)

Luca Motta
Luca Motta

Reputation: 331

Data storage handling can reside in the machine where the code telegram bot run. I developed telegram bot with node-telegram-bot-api. For data storage i used mongodb (if you are using NodeJS can follow this guide). If you will choose to use mongodb consider that you can use it with several frameworks/programming languages.

Upvotes: 1

Luca Schimweg
Luca Schimweg

Reputation: 797

I don't get what you want to do. A telegram bot is running on your server and does only reply or send messages to the user. When you want to save data for the user, you have to save it on the server. Assuming you are using C#, you could use a database or a simple Dictionary with the UserID as key and your data as the value. Your bot can't run any code on the phone, so there is no possibility to save data there.

Upvotes: 13

Related Questions