Commit 9e0e0b76 by Oleksandr Barabash

special commands added

parent 2b30260c
......@@ -20,6 +20,10 @@ en:
cmd_portal: "portal"
cmd_mars: "mars"
cmd_upload: "upload"
cmd_mars_auth: "mars-auth"
portal_text: "Open secured portal"
......@@ -40,3 +44,6 @@ en:
text_authorize: "Authorize"
text_service_acc_auth: "Service account authorization:"
text_upload_title: "Open Upload page"
text_upload_header: "Upload media file"
......@@ -387,6 +387,24 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
cmd_sharepoint_acc = i18n.t("cmd_sharepoint_acc")
cmd_mars_auth = i18n.t("cmd_mars_auth")
cmd_mars = i18n.t("cmd_mars")
cmd_upload = i18n.t("cmd_upload")
if message_lower in [cmd_mars.lower(), cmd_upload.lower()]:
header = i18n.t("text_upload_header")
title = i18n.t("text_upload_title")
url = self.generate_url(f"https://{AppConfig.MARS_FQDN}/",
turn_context.activity.conversation.id)
card = CardHelper.load_assets_card("link_card",
context=dict(title=title,
url=url,
header=header))
attachments = [CardFactory.adaptive_card(card)]
await turn_context.send_activity(
Activity(type=ActivityTypes.message, attachments=attachments)
)
return
if message_lower == cmd_mars_auth.lower():
header = i18n.t("text_service_acc_auth")
title = i18n.t("text_authorize")
......
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