2e44df0bbd
All checks were successful
continuous-integration/drone/push Build is passing
`telegram` module. Closes #2 #7. Two service classes: * `Notifier` class * `CommandProcessor` class Two [middlewares](https://github.com/eternnoir/pyTelegramBotAPI/tree/master/examples/middleware): * `UserAuthMiddleware` * `ExceptionHandlerMiddleware` One exception for usage in the code called by the bot: * `DisplayableException` Merge **ONLY** after #9 is merged. Reviewed-on: #10 Reviewed-by: Miroslavsckaya <miroslavsckaya@noreply.git.skobk.in>
19 lines
322 B
Python
19 lines
322 B
Python
import logging
|
|
import os
|
|
from dotenv import load_dotenv
|
|
|
|
from database import Database
|
|
from telegram import CommandProcessor
|
|
|
|
|
|
load_dotenv()
|
|
|
|
token = os.getenv('TELEGRAM_TOKEN')
|
|
db_path = os.getenv('DATABASE_PATH')
|
|
|
|
db = Database(db_path)
|
|
bot = CommandProcessor(token, db)
|
|
|
|
logging.info("Starting Telegram bot")
|
|
bot.run()
|