Commit 9382fc4f by Oleksandr Barabash

notification_id logged

parent 6a8b86f6
""" Bot App """
import json
import logging
import sys
import time
import traceback
......@@ -43,6 +44,7 @@ app_settings = BotFrameworkAdapterSettings(app_config.APP_ID,
ADAPTER = BotFrameworkAdapter(app_settings)
BOT = TeamsMessagingExtensionsActionPreviewBot(app_settings, ADAPTER)
TAG = __name__
log = logging.getLogger()
# noinspection PyShadowingNames
......@@ -154,6 +156,7 @@ async def v1_post_notification(request: Request) -> Response:
schema = Notification.get_schema(unknown=EXCLUDE)
notification = schema.load(json_loads(request_body, {})).to_db()
notification_id = await BOT.send_notification(notification)
log.info(f"notification_id: {notification_id}")
data = dict(notificationId=notification_id)
body = dict(status=dict(message="OK", code=200), data=data)
return Response(body=json.dumps(body), status=HTTPStatus.OK)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment