diff --git a/src/bot.py b/src/bot.py index 3caca88..6cad92f 100644 --- a/src/bot.py +++ b/src/bot.py @@ -6,11 +6,11 @@ from telegram.ext import Updater import logging import os -from src.commands import start +from src.commands import * +from src.constants import dbPath, token from src.database import Database -token = os.environ['TG_TOKEN'] -dbPath = 'database.json' + database = Database() # Main @@ -25,7 +25,7 @@ if __name__ == '__main__': f.close() # Create bot - bot = telegram.Bot(token=os.environ['TG_TOKEN']) + bot = telegram.Bot(token=token) # Print bot info print("Bot created: ", bot.getMe()) diff --git a/src/constants.py b/src/constants.py new file mode 100644 index 0000000..ee4983d --- /dev/null +++ b/src/constants.py @@ -0,0 +1,4 @@ +import os + +token = os.environ['TG_TOKEN'] +dbPath = 'database.json' diff --git a/src/database.py b/src/database.py index f392417..3b9de14 100644 --- a/src/database.py +++ b/src/database.py @@ -1,6 +1,6 @@ import json -from src.bot import dbPath +from src.constants import dbPath class Database: