W
W
William Horn2019-11-15 15:02:35
Python
William Horn, 2019-11-15 15:02:35

What can I replace the file system for the VK bot on heroku to work with?

Good afternoon.
Wrote a bot for VK. It randomly selects a person from the registrants (registration via team) and assigns him the "bad person" of the day. It all works through regular .txt files, in one folder a file is created with the id of the conversation, registered people (their id-shniks) are recorded there, in another folder there is a .txt file, again, with the name id of the conversation and the current date is recorded in it, to control the activation of the command once every 24 hours.
The essence of the problem is that I put the bot on heroku, but there is no support for files and they are deleted after a while. Therefore, you need to somehow implement this through the database. And now I don’t understand how this can be done, because I didn’t work with the database. Do I need to create a table for each conversation?
If there is any other way, then I'm waiting for advice :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey_Dolg, 2019-11-15
@w_horn

If a database goes to Herok, use it. I'm not entirely sure about "there is no support for files and they are deleted after a while." then your scripts would be deleted after a while. Although it is possible that you write a file in the temporary directory of the script execution and after the end the file disappears (rather it remains but you do not know the path to it). Figure out where your primary script is and write to the same directory. If not at all, use google spredsheet to store data. But honestly, I think you're doing something wrong.
UPD
The algorithm is simple, we go into the documentation and figure out how to connect the database, like 10k records for free.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question