(token: str)
| 12 | |
| 13 | @app.route(f"/{config.WEBHOOK_PATH}/<token>", methods=['POST']) |
| 14 | def webhook(token: str): |
| 15 | if not tokens.get(token): |
| 16 | return abort(404) |
| 17 | |
| 18 | if request.headers.get('content-type') != 'application/json': |
| 19 | return abort(403) |
| 20 | |
| 21 | json_string = request.get_data().decode('utf-8') |
| 22 | update = types.Update.de_json(json_string) |
| 23 | if token == main_bot.token: |
| 24 | main_bot.process_new_updates([update]) |
| 25 | return '' |
| 26 | |
| 27 | from_update_bot = TeleBot(token) |
| 28 | register_handlers(from_update_bot) |
| 29 | from_update_bot.process_new_updates([update]) |
| 30 | return '' |
| 31 | |
| 32 | |
| 33 | @main_bot.message_handler(commands=['add_bot']) |
nothing calls this directly
no test coverage detected
searching dependent graphs…