Skip to content

Commit aeaac33

Browse files
webhook usage only in production mode
1 parent 156ced1 commit aeaac33

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

telegram_bot/blueprint.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
telegram_blueprint = Blueprint('telegram_blueprint', __name__)
99

10-
11-
@telegram_blueprint.before_app_first_request
12-
def init_telegram_blueprint():
13-
bot = set_webhook()
14-
create_dispatcher(bot)
10+
if not current_app.config['DEBUG']:
11+
@telegram_blueprint.before_app_first_request
12+
def init_telegram_blueprint():
13+
bot = set_webhook()
14+
create_dispatcher(bot)
1515

1616

1717
@telegram_blueprint.route(

0 commit comments

Comments
 (0)