コード例 #1
0
def index():
    try:
        bot.remove_webhook()
        bot.set_webhook(url="https://{}.herokuapp.com/{}".format(
            constants.appName, constants.token))
    except Exception:
        print('Frontend only')

    return pages.main()
コード例 #2
0
def index():
    bot.remove_webhook()
    bot.set_webhook(url="https://{}.herokuapp.com/{}".format(APP_NAME, TOKEN))
    return "radashop_new_bot!", 200
コード例 #3
0
ファイル: run_server.py プロジェクト: askfm-bot/telegram-bot
def index():
    bot.remove_webhook()
    bot.set_webhook(url='https://{}.herokuapp.com/{}'.format(
        config.APP_NAME, config.TOKEN))
    return 'Hello from Lapochka!', 200
コード例 #4
0
def index():
    bot.remove_webhook()
    bot.set_webhook(url="https://{}.herokuapp.com/{}".format(APP_NAME, TOKEN))
    return "Hello from Heroku!", 200
コード例 #5
0
from bot_handlers import bot
import threading
import bot_methods


app = flask.Flask(__name__)
threading.Thread(target=bot_methods.handle_monitorings, args=(bot,)).start()

@app.route(WEBHOOK_URL_PATH, methods=['POST'])
def web_hook():
    if flask.request.headers.get('content-type') == 'application/json':
        json_string = flask.request.get_data().decode('utf-8')
        update = types.Update.de_json(json_string)
        bot.process_new_updates([update])
        return ''
    else:
        flask.abort(403)


if __name__ == "__main__":
    bot.polling(none_stop=True)
    bot.remove_webhook()
    sleep(1)
    bot.set_webhook(url=WEBHOOK_URL_BASE + WEBHOOK_URL_PATH,
                                certificate=open(WEBHOOK_SSL_CERT, 'r'))
    app.run(host=WEBHOOK_LISTEN,
            port=WEBHOOK_PORT,
            ssl_context=(WEBHOOK_SSL_CERT, WEBHOOK_SSL_PRIV),
            threaded=True
            )
コード例 #6
0
ファイル: run_server.py プロジェクト: ayudov/UMGBot
def index():
    bot.remove_webhook()
    bot.set_webhook(url=NGROK + '/{}'.format(TOKEN))
    return WORKING_WELL, 200
コード例 #7
0
ファイル: run_server.py プロジェクト: olegggwp/plgr
def index():
    bot.remove_webhook()
    bot.set_webhook(url="https://{}.herokuapp.com/{}".format(APP_NAME, TOKEN))
    return "This site is created by oleg_ggwp gang to monitoring telegram bot", 200
コード例 #8
0
ファイル: run_server.py プロジェクト: skipfromua/profile_bot
def index():
    bot.remove_webhook()
    bot.set_webhook(
        url="https://pacific-thicket-10824.herokuapp.com/{}".format(TOKEN))
    return "Hello from Heroku!", 200
コード例 #9
0
def webhook():
    bot.remove_webhook()
    bot.set_webhook(
        url=f'https://course-helper-bot-kpi.herokuapp.com/{BOT_TOKEN}')
    return "!", 200
コード例 #10
0
ファイル: run_server.py プロジェクト: eskrynnyk/repo_bot
def index():
    bot.remove_webhook()
    bot.set_webhook(url="https://{}.herokuapp.com/{}".format('1136026078:AAHYkWNwfDiXtzzdShyHQ8EB2tkvFZxwzCM'))
    return "Hello from Heroku!", 200
コード例 #11
0
def index():
    bot.remove_webhook()
    bot.set_webhook(
        url="https://{}.herokuapp.com/{}".format(APP_NAME, TG_TOKEN))
    return "Ну и че ты тут собирался увидеть, пидр?", 200