Answer the question
In order to leave comments, you need to log in
How to deploy sqlite3 + python telegram bot to hosting?
Hello. I'm not experienced in this area, but the documentation did not work out. Tried to deploy a telegram bot using the sqlite3 database on Heroku, but without success. Understood that it deletes data after reboot. How can this be fixed?
Code part:
import telebot
import random
from telebot import types
import config
import sqlite3
import threading
global db
global sql
db=sqlite3.connect('gamers.db', check_same_thread=False)
sql=db.cursor()
sql.execute("""CREATE TABLE IF NOT EXISTS players (chatid TEXT, username TEXT, cash INT, inbank INT, total INT, job_blocked TEXT)""")
db.commit()
bot=telebot.TeleBot(config.TOKEN)
Answer the question
In order to leave comments, you need to log in
Don't use Sqlite on Heroku.
https://devcenter.heroku.com/articles/sqlite3
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question