def get_app(self, static_serve=False) -> web.Application:
"""
Create aiohttp application for webhook handling
"""
app = get_app(self, static_serve=static_serve)
# webhook handler
webhook_path = urlparse(self.webhook).path
app.router.add_post(webhook_path, self.webhook_handle)
# viber webhooks registering
if self._unset_webhook_on_cleanup:
app.on_cleanup.append(lambda a: a.bot.api.unset_webhook())
if self._set_webhook_on_startup:
app.on_startup.append(lambda a: a.bot.set_webhook_on_startup())
return app
评论列表
文章目录