8000 Fix get_skill_conversation_reference in skill_handler (#1728) · marmikreal/botbuilder-python@167da30 · GitHub
[go: up one dir, main page]

Skip to content

Commit 167da30

Browse files
authored
Fix get_skill_conversation_reference in skill_handler (microsoft#1728)
* Add check for instance of SkillConversationReference * Apply black styling
1 parent f5f8c2e commit 167da30

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

libraries/botbuilder-core/botbuilder/core/skills/skill_handler.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,18 @@ async def _get_skill_conversation_reference(
200200
conversation_id
201201
)
202202

203-
skill_conversation_reference: SkillConversationReference = SkillConversationReference(
204-
conversation_reference=conversation_reference,
205-
oauth_scope=(
206-
GovernmentConstants.TO_CHANNEL_FROM_BOT_OAUTH_SCOPE
207-
if self._channel_provider and self._channel_provider.is_government()
208-
else AuthenticationConstants.TO_CHANNEL_FROM_BOT_OAUTH_SCOPE
209-
),
210-
)
203+
if isinstance(conversation_reference, SkillConversationReference):
204+
skill_conversation_reference: SkillConversationReference = conversation_reference
205+
else:
206+
skill_conversation_reference: SkillConversationReference = SkillConversationReference(
207+
conversation_reference=conversation_reference,
208+
oauth_scope=(
209+
GovernmentConstants.TO_CHANNEL_FROM_BOT_OAUTH_SCOPE
210+
if self._channel_provider
211+
and self._channel_provider.is_government()
212+
else AuthenticationConstants.TO_CHANNEL_FROM_BOT_OAUTH_SCOPE
213+
),
214+
)
211215

212216
if not skill_conversation_reference:
213217
raise KeyError("SkillConversationReference not found")

0 commit comments

Comments
 (0)
0