How to continue where it left off

I hosting my Discord Bot with glitch. Naturally sometimes bot’s restart self and and transactions are interrupting Is there anything I can do to continue where it left off?

You could save the current transaction to a file, or a DB. When the bot restarts, it could read the file / DB and continue whatever it was doing.

How can i do that? You can send to me Any example video or something?

I’m going to assume that you are storing stuff in memory. This isn’t really a good idea because as you’ve probably observed it all goes away upon reboot. The solution to this is to implement a database.

Glitch has sqlite3 template when you create a project - I suggest you toy around with that and experiment with implementing a sqlite3 database into your bot.

1 Like