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
bf949ed1
Commit
bf949ed1
authored
Jan 27, 2023
by
Oleksandr Barabash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
notification.destination changed to notification.conversation_id
parent
d61f7754
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
+5
-11
messaging_extension_action_preview_bot.py
bots/messaging_extension_action_preview_bot.py
+3
-9
notification.py
entities/json/notification.py
+2
-2
No files found.
bots/messaging_extension_action_preview_bot.py
View file @
bf949ed1
...
@@ -166,7 +166,7 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
...
@@ -166,7 +166,7 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
""" async routine """
""" async routine """
try
:
try
:
reference
=
await
self
.
cosmos_client
.
get_conversation
(
reference
=
await
self
.
cosmos_client
.
get_conversation
(
notification
.
destination
notification
.
conversation_id
)
)
except
ItemNotFound
:
except
ItemNotFound
:
future
.
set_exception
(
ConversationNotFound
(
"not found"
))
future
.
set_exception
(
ConversationNotFound
(
"not found"
))
...
@@ -178,19 +178,13 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
...
@@ -178,19 +178,13 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
async
def
callback
(
turn_context
:
TurnContext
)
->
None
:
async
def
callback
(
turn_context
:
TurnContext
)
->
None
:
""" Turn Context callback. Kinda awful syntax, I know """
""" Turn Context callback. Kinda awful syntax, I know """
try
:
try
:
card
=
CardHelper
.
create_notification_card
(
card
=
CardHelper
.
create_notification_card
(
notification
)
await
self
.
cosmos_client
.
create_notification
(
notification
)
)
attachments
=
[
CardFactory
.
adaptive_card
(
card
)]
attachments
=
[
CardFactory
.
adaptive_card
(
card
)]
message
=
Activity
(
type
=
ActivityTypes
.
message
,
message
=
Activity
(
type
=
ActivityTypes
.
message
,
attachments
=
attachments
)
attachments
=
attachments
)
response
=
await
turn_context
.
send_activity
(
message
)
response
=
await
turn_context
.
send_activity
(
message
)
notification
.
message_id
=
response
.
id
notification
.
message_id
=
response
.
id
await
self
.
cosmos_client
.
update_notification
(
await
self
.
cosmos_client
.
create_notification
(
notification
)
notification
)
print
(
f
"notification response: {response}"
)
print
(
f
"notification response: {response}"
)
future
.
set_result
(
notification
.
id
)
future
.
set_result
(
notification
.
id
)
except
Exception
as
exception
:
except
Exception
as
exception
:
...
...
entities/json/notification.py
View file @
bf949ed1
...
@@ -17,7 +17,7 @@ class NotificationUrl(CamelCaseMixin):
...
@@ -17,7 +17,7 @@ class NotificationUrl(CamelCaseMixin):
class
Notification
(
CamelCaseMixin
):
class
Notification
(
CamelCaseMixin
):
""" Notification Dataclass """
""" Notification Dataclass """
message_id
:
Optional
[
str
]
message_id
:
Optional
[
str
]
destination
:
str
conversation_id
:
str
subject
:
Optional
[
str
]
=
field
(
default
=
None
)
subject
:
Optional
[
str
]
=
field
(
default
=
None
)
message
:
Optional
[
str
]
=
field
(
default
=
None
)
message
:
Optional
[
str
]
=
field
(
default
=
None
)
title
:
Optional
[
str
]
=
field
(
default
=
None
)
title
:
Optional
[
str
]
=
field
(
default
=
None
)
...
@@ -28,7 +28,7 @@ class Notification(CamelCaseMixin):
...
@@ -28,7 +28,7 @@ class Notification(CamelCaseMixin):
def
to_db
(
self
)
->
"NotificationCosmos"
:
def
to_db
(
self
)
->
"NotificationCosmos"
:
""" Create NotificationCosmos """
""" Create NotificationCosmos """
return
NotificationCosmos
(
message_id
=
self
.
message_id
,
return
NotificationCosmos
(
message_id
=
self
.
message_id
,
destination
=
self
.
destination
,
conversation_id
=
self
.
conversation_id
,
subject
=
self
.
subject
,
subject
=
self
.
subject
,
message
=
self
.
message
,
message
=
self
.
message
,
title
=
self
.
title
,
title
=
self
.
title
,
...
...
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