diff --git a/.env.local b/.env.local index a0bec50..eb624cf 100644 --- a/.env.local +++ b/.env.local @@ -4,5 +4,3 @@ firebase_authDomain= firebase_databaseURL= firebase_projectId= firebase_storageBucket= -app_url= -PORT= \ No newline at end of file diff --git a/README.md b/README.md index 2d254aa..a4ecb9b 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,6 @@ cp .env.local .env and then fulfill copied `.env` file with required values - `bot_token` - your telegram bot token from [BotFather](https://telegram.me/BotFather) - `firebase_*` - all of those values you can find in firebase console -- `app_url` - your app url for retrieving webhooks -- `PORT` - port for your app ### Commands #### `/in` diff --git a/src/app.py b/src/app.py index 42eb3d2..a27caca 100644 --- a/src/app.py +++ b/src/app.py @@ -1,4 +1,4 @@ -from .config.credentials import bot_token, app_url, port +from .config.credentials import bot_token from .config.handlers import handlers from .handlers.handlerInterface import HandlerInterface from telegram.ext.dispatcher import Dispatcher @@ -14,8 +14,7 @@ class App: def run(self) -> None: self.registerHandlers() - self.registerWebhook() - + self.updater.start_polling() self.updater.idle() def registerHandlers(self) -> None: @@ -24,11 +23,3 @@ class App: raise Exception('Invalid list of handlers provided. Handler must implement HandlerInterface') self.updater.dispatcher.add_handler(handler.getBotHandler()) - - def registerWebhook(self) -> None: - self.updater.start_webhook( - listen="0.0.0.0", - port=int(port), - url_path=bot_token, - webhook_url=f'{app_url}/{bot_token}' - ) diff --git a/src/config/credentials.py b/src/config/credentials.py index 8cb7c00..072318f 100644 --- a/src/config/credentials.py +++ b/src/config/credentials.py @@ -4,8 +4,6 @@ from dotenv import load_dotenv load_dotenv() bot_token = os.environ['bot_token'] -app_url = os.environ['app_url'] -port = os.environ['PORT'] firebaseConfig = { "apiKey": os.environ['firebase_apiKey'],