Telebot with memory extension. It supports add a database backend to save chat histories.
Install from Pypi or from source
python3 -m pip install telebot-mem
start a docker instance of mongo for quick experimentation
mkdir -p local/db
docker run -v ./local/db/:/data/db --rm -d -p 27017:27017 --name=mongo-test mongo:latest
memdb = MongoMem("mongodb://localhost:27017/", "telegram")
@bot.message_handler(func=lambda message: True)
@memdb.memorize
def echo_message(message):
...
Refer to echo bot example with mongodb
- Test interface for mongodb support