Skip to content

class Tourmaline::JsonPersistence
inherits Tourmaline::HashPersistence #

Persists users and chats in a json file. This isn't the most efficient, but it is easy to set up for testing.

Constructors#

.new(filename = "tourmaline_persistence.json") #

View source

Methods#

#cleanup #

Gets called upon exit. It can be used to perform any necessary cleanup.

View source

#filename : String #

View source

#filename=(filename : String) #

View source

#init #

Gets called when the bot is initialized. This can be used for setup if you need access to the bot instance.

View source