Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cake-bot
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Oleksandr Barabash
cake-bot
Commits
6af0edef
Commit
6af0edef
authored
Jan 05, 2023
by
Oleksandr Barabash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix on cards
parent
add97a9a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
messaging_extension_action_preview_bot.py
bots/messaging_extension_action_preview_bot.py
+9
-3
pa_message.py
entities/json/pa_message.py
+2
-2
No files found.
bots/messaging_extension_action_preview_bot.py
View file @
6af0edef
...
...
@@ -4,7 +4,7 @@ import sys
import
time
import
uuid
from
asyncio
import
Future
from
typing
import
Optional
,
Dict
from
typing
import
Optional
,
Dict
,
Union
,
List
from
urllib.parse
import
urlparse
,
parse_qsl
,
urlencode
,
unquote
import
aiohttp
...
...
@@ -85,7 +85,8 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
def
send_message
(
self
,
conversation_id
:
str
,
tenant_id
:
str
,
text
:
str
=
None
,
card
:
Dict
[
any
,
any
]
=
None
)
->
Future
[
ResourceResponse
]:
card
:
Optional
[
Union
[
List
,
Dict
[
any
,
any
]]]
=
None
)
->
Future
[
ResourceResponse
]:
""" Send message as a bot """
io_loop
=
asyncio
.
get_event_loop
()
future
=
Future
()
...
...
@@ -108,7 +109,12 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
try
:
attachments
=
None
if
card
is
not
None
:
attachments
=
[
CardFactory
.
adaptive_card
(
card
)]
if
isinstance
(
card
,
list
):
attachments
=
[
CardFactory
.
adaptive_card
(
x
)
for
x
in
card
]
else
:
attachments
=
[
CardFactory
.
adaptive_card
(
card
)]
response
=
await
turn_context
.
send_activity
(
Activity
(
type
=
ActivityTypes
.
message
,
...
...
entities/json/pa_message.py
View file @
6af0edef
""" PA message to send to Teams """
from
dataclasses
import
dataclass
from
typing
import
Optional
from
typing
import
Optional
,
Union
,
List
,
Dict
from
entities.json.camel_case_mixin
import
CamelCaseMixin
...
...
@@ -11,4 +11,4 @@ class PAMessage(CamelCaseMixin):
conversation_id
:
str
tenant_id
:
str
text
:
Optional
[
str
]
card
:
Optional
[
str
]
card
:
Optional
[
Union
[
Dict
,
List
]
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment