Answer the question
In order to leave comments, you need to log in
What method of secure storage, writing and reading of data can be applied to a bot in python 3 that forwards messages from social networks. networks.?
I am writing a bot that forwards messages from VK to Discord. The algorithm is as follows: Incoming messages are written to a dictionary and added to the "Buffer" list (Example: Buffer = [{'text': "message text", 'date': "a specific date that is extracted from the text",'time':" time that is extracted from the text"}, ...] )
In parallel, another method works, which checks every 60 seconds whether the time specified in the Buffer[] elements has come, if yes, then the message is sent to the discord chat, and the element is deleted. But there is a problem - the bot may restart, and Buffer[] will be deleted accordingly, and data will be lost. Question: What is the best way to proceed in this case?
PS: I was thinking of using sqllite3, but I don't know how to implement the .pop() and .append() functions there. + I don't understand how the values in the table columns are indexed there
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question