Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if __name__ == '__main__':
- if ARGS['production'] == True:
- print(ARGS['production'])
- bot.remove_webhook()
- bot.set_webhook(url=WEBHOOK_URL_BASE + WEBHOOK_URL_PATH,
- certificate=open(WEBHOOK_SSL_CERT, 'r'))
- # settings for cherrypy server
- cherrypy.config.update({
- 'server.socket_host': WEBHOOK_LISTEN,
- 'server.socket_port': WEBHOOK_PORT,
- 'server.ssl_module': 'builtin',
- 'server.ssl_certificate': WEBHOOK_SSL_CERT,
- 'server.ssl_private_key': WEBHOOK_SSL_PRIV,
- })
- # daemonize so process runs in background.
- from cherrypy.process.plugins import Daemonizer
- d = Daemonizer(cherrypy.engine)
- d.subscribe()
- # launch!
- cherrypy.quickstart(WebhookServer(), WEBHOOK_URL_PATH, {'/': {}})
- else:
- bot.remove_webhook()
- bot.polling()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement