Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libraries/botbuilder-core/botbuilder/core/activity_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async def on_turn(self, turn_context: TurnContext):
elif turn_context.activity.type == ActivityTypes.event:
await self.on_event_activity(turn_context)
elif turn_context.activity.type == ActivityTypes.end_of_conversation:
await self.on_end_of_conversation(turn_context)
await self.on_end_of_conversation_activity(turn_context)
else:
await self.on_unrecognized_activity_type(turn_context)

Expand Down Expand Up @@ -106,7 +106,7 @@ async def on_event( # pylint: disable=unused-argument
):
return

async def on_end_of_conversation( # pylint: disable=unused-argument
async def on_end_of_conversation_activity( # pylint: disable=unused-argument
self, turn_context: TurnContext
):
return
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

from typing import Awaitable, Callable, List, Union

from .bot_state import BotState
Expand Down
3 changes: 3 additions & 0 deletions libraries/botbuilder-core/botbuilder/core/bot_state_set.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

from asyncio import wait
from typing import List
from .bot_state import BotState
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

from aiohttp.web import (
middleware,
HTTPNotImplemented,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

from .bot_state import BotState
from .turn_context import TurnContext
from .storage import Storage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

import time
from functools import wraps
from typing import Awaitable, Callable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

from botbuilder.schema import Activity
from botbuilder.schema.teams import NotificationInfo, TeamsChannelData, TeamInfo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async def on_invoke_activity(self, turn_context: TurnContext) -> InvokeResponse:
not turn_context.activity.name
and turn_context.activity.channel_id == Channels.ms_teams
):
return await self.on_teams_card_action_invoke_activity(turn_context)
return await self.on_teams_card_action_invoke(turn_context)

if turn_context.activity.name == "signin/verifyState":
await self.on_teams_signin_verify_state(turn_context)
Expand Down Expand Up @@ -174,7 +174,7 @@ async def on_invoke_activity(self, turn_context: TurnContext) -> InvokeResponse:
except _InvokeResponseException as err:
return err.create_invoke_response()

async def on_teams_card_action_invoke_activity(
async def on_teams_card_action_invoke(
self, turn_context: TurnContext
) -> InvokeResponse:
raise _InvokeResponseException(status_code=HTTPStatus.NOT_IMPLEMENTED)
Expand All @@ -188,13 +188,13 @@ async def on_teams_file_consent(
file_consent_card_response: FileConsentCardResponse,
) -> InvokeResponse:
if file_consent_card_response.action == "accept":
await self.on_teams_file_consent_accept_activity(
await self.on_teams_file_consent_accept(
turn_context, file_consent_card_response
)
return self._create_invoke_response()

if file_consent_card_response.action == "decline":
await self.on_teams_file_consent_decline_activity(
await self.on_teams_file_consent_decline(
turn_context, file_consent_card_response
)
return self._create_invoke_response()
Expand All @@ -204,14 +204,14 @@ async def on_teams_file_consent(
f"{file_consent_card_response.action} is not a supported Action.",
)

async def on_teams_file_consent_accept_activity( # pylint: disable=unused-argument
async def on_teams_file_consent_accept( # pylint: disable=unused-argument
self,
turn_context: TurnContext,
file_consent_card_response: FileConsentCardResponse,
):
raise _InvokeResponseException(status_code=HTTPStatus.NOT_IMPLEMENTED)

async def on_teams_file_consent_decline_activity( # pylint: disable=unused-argument
async def on_teams_file_consent_decline( # pylint: disable=unused-argument
self,
turn_context: TurnContext,
file_consent_card_response: FileConsentCardResponse,
Expand Down Expand Up @@ -242,17 +242,17 @@ async def on_teams_messaging_extension_submit_action_dispatch(
self, turn_context: TurnContext, action: MessagingExtensionAction
) -> MessagingExtensionActionResponse:
if not action.bot_message_preview_action:
return await self.on_teams_messaging_extension_submit_action_activity(
return await self.on_teams_messaging_extension_submit_action(
turn_context, action
)

if action.bot_message_preview_action == "edit":
return await self.on_teams_messaging_extension_bot_message_preview_edit_activity(
return await self.on_teams_messaging_extension_bot_message_preview_edit(
turn_context, action
)

if action.bot_message_preview_action == "send":
return await self.on_teams_messaging_extension_bot_message_preview_send_activity(
return await self.on_teams_messaging_extension_bot_message_preview_send(
turn_context, action
)

Expand All @@ -261,17 +261,17 @@ async def on_teams_messaging_extension_submit_action_dispatch(
body=f"{action.bot_message_preview_action} is not a supported BotMessagePreviewAction",
)

async def on_teams_messaging_extension_bot_message_preview_edit_activity( # pylint: disable=unused-argument
self, turn_context: TurnContext, action
async def on_teams_messaging_extension_bot_message_preview_edit( # pylint: disable=unused-argument
self, turn_context: TurnContext, action: MessagingExtensionAction
) -> MessagingExtensionActionResponse:
raise _InvokeResponseException(status_code=HTTPStatus.NOT_IMPLEMENTED)

async def on_teams_messaging_extension_bot_message_preview_send_activity( # pylint: disable=unused-argument
self, turn_context: TurnContext, action
async def on_teams_messaging_extension_bot_message_preview_send( # pylint: disable=unused-argument
self, turn_context: TurnContext, action: MessagingExtensionAction
) -> MessagingExtensionActionResponse:
raise _InvokeResponseException(status_code=HTTPStatus.NOT_IMPLEMENTED)

async def on_teams_messaging_extension_submit_action_activity( # pylint: disable=unused-argument
async def on_teams_messaging_extension_submit_action( # pylint: disable=unused-argument
self, turn_context: TurnContext, action: MessagingExtensionAction
) -> MessagingExtensionActionResponse:
raise _InvokeResponseException(status_code=HTTPStatus.NOT_IMPLEMENTED)
Expand Down Expand Up @@ -313,41 +313,40 @@ async def on_conversation_update_activity(self, turn_context: TurnContext):
turn_context.activity.channel_data
)
if turn_context.activity.members_added:
return await self.on_teams_members_added_dispatch_activity(
return await self.on_teams_members_added_dispatch(
turn_context.activity.members_added, channel_data.team, turn_context
)

if turn_context.activity.members_removed:
return await self.on_teams_members_removed_dispatch_activity(
return await self.on_teams_members_removed_dispatch(
turn_context.activity.members_removed,
channel_data.team,
turn_context,
)

if channel_data:
if channel_data.event_type == "channelCreated":
return await self.on_teams_channel_created_activity(
return await self.on_teams_channel_created(
ChannelInfo().deserialize(channel_data.channel),
channel_data.team,
turn_context,
)
if channel_data.event_type == "channelDeleted":
return await self.on_teams_channel_deleted_activity(
return await self.on_teams_channel_deleted(
channel_data.channel, channel_data.team, turn_context
)
if channel_data.event_type == "channelRenamed":
return await self.on_teams_channel_renamed_activity(
return await self.on_teams_channel_renamed(
channel_data.channel, channel_data.team, turn_context
)
if channel_data.event_type == "teamRenamed":
return await self.on_teams_team_renamed_activity(
channel_data.team, turn_context
)
return await super().on_conversation_update_activity(turn_context)

return await super().on_conversation_update_activity(turn_context)

async def on_teams_channel_created_activity( # pylint: disable=unused-argument
async def on_teams_channel_created( # pylint: disable=unused-argument
self, channel_info: ChannelInfo, team_info: TeamInfo, turn_context: TurnContext
):
return
Expand All @@ -357,7 +356,7 @@ async def on_teams_team_renamed_activity( # pylint: disable=unused-argument
):
return

async def on_teams_members_added_dispatch_activity( # pylint: disable=unused-argument
async def on_teams_members_added_dispatch( # pylint: disable=unused-argument
self,
members_added: [ChannelAccount],
team_info: TeamInfo,
Expand Down Expand Up @@ -387,11 +386,11 @@ async def on_teams_members_added_dispatch_activity( # pylint: disable=unused-ar
)
team_members_added.append(new_teams_channel_account)

return await self.on_teams_members_added_activity(
return await self.on_teams_members_added(
team_members_added, team_info, turn_context
)

async def on_teams_members_added_activity( # pylint: disable=unused-argument
async def on_teams_members_added( # pylint: disable=unused-argument
self,
teams_members_added: [TeamsChannelAccount],
team_info: TeamInfo,
Expand All @@ -405,7 +404,7 @@ async def on_teams_members_added_activity( # pylint: disable=unused-argument
teams_members_added, turn_context
)

async def on_teams_members_removed_dispatch_activity( # pylint: disable=unused-argument
async def on_teams_members_removed_dispatch( # pylint: disable=unused-argument
self,
members_removed: [ChannelAccount],
team_info: TeamInfo,
Expand All @@ -421,11 +420,9 @@ async def on_teams_members_removed_dispatch_activity( # pylint: disable=unused-
TeamsChannelAccount().deserialize(new_account_json)
)

return await self.on_teams_members_removed_activity(
teams_members_removed, turn_context
)
return await self.on_teams_members_removed(teams_members_removed, turn_context)

async def on_teams_members_removed_activity(
async def on_teams_members_removed(
self, teams_members_removed: [TeamsChannelAccount], turn_context: TurnContext
):
members_removed = [
Expand All @@ -434,12 +431,12 @@ async def on_teams_members_removed_activity(
]
return await super().on_members_removed_activity(members_removed, turn_context)

async def on_teams_channel_deleted_activity( # pylint: disable=unused-argument
async def on_teams_channel_deleted( # pylint: disable=unused-argument
self, channel_info: ChannelInfo, team_info: TeamInfo, turn_context: TurnContext
):
return # Task.CompleteTask

async def on_teams_channel_renamed_activity( # pylint: disable=unused-argument
async def on_teams_channel_renamed( # pylint: disable=unused-argument
self, channel_info: ChannelInfo, team_info: TeamInfo, turn_context: TurnContext
):
return # Task.CompleteTask
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

from inspect import getmembers
from typing import Type
from enum import Enum
Expand Down
Loading