MCPcopy Create free account
hub / github.com/eternnoir/pyTelegramBotAPI / webhook

Function webhook

examples/webhook_examples/webhook_flask_echo_bot.py:50–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48# Process webhook calls
49@app.route(WEBHOOK_URL_PATH, methods=['POST'])
50def webhook():
51 if flask.request.headers.get('content-type') == 'application/json':
52 json_string = flask.request.get_data().decode('utf-8')
53 update = telebot.types.Update.de_json(json_string)
54 bot.process_new_updates([update])
55 return ''
56 else:
57 flask.abort(403)
58
59
60# Handle '/start' and '/help'

Callers

nothing calls this directly

Calls 4

getMethod · 0.45
get_dataMethod · 0.45
de_jsonMethod · 0.45
process_new_updatesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…