From dc6108bbf7973d61c46b73e94084aa20b4db8907 Mon Sep 17 00:00:00 2001 From: Michael Miele Date: Fri, 17 Jan 2020 16:09:57 -0800 Subject: [PATCH 1/4] Update activity_handler.py Added ref docuimentation --- .../botbuilder/core/activity_handler.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/libraries/botbuilder-core/botbuilder/core/activity_handler.py b/libraries/botbuilder-core/botbuilder/core/activity_handler.py index 40c06d91e..27b24a3ea 100644 --- a/libraries/botbuilder-core/botbuilder/core/activity_handler.py +++ b/libraries/botbuilder-core/botbuilder/core/activity_handler.py @@ -8,6 +8,23 @@ class ActivityHandler: async def on_turn(self, turn_context: TurnContext): + """ Called by the adapter (for example, :class:`BotFrameworkAdapter`) at runtime + in order to process an inbound :class:`botbuilder.schema.Activity`. + + :param turn_context: The context object for this turn + :type turn_context: :class:`TurnContext` + + :returns: A task that represents the work queued to execute + + .. remarks:: + It calls other methods in this class based on the type of the activity to + process, which allows a derived class to provide type-specific logic in a controlled way. + In a derived class, override this method to add logic that applies to all activity types. + + .. note:: + - Add logic to apply before the type-specific logic and before the call to the base class `OnTurnAsync` method. + - Add logic to apply after the type-specific logic after the call to the base class `OnTurnAsync` method. + """ if turn_context is None: raise TypeError("ActivityHandler.on_turn(): turn_context cannot be None.") @@ -40,6 +57,18 @@ async def on_turn(self, turn_context: TurnContext): async def on_message_activity( # pylint: disable=unused-argument self, turn_context: TurnContext ): + """Override this method in a derived class to provide logic specific to activities, + such as the conversational logic. + + :param turn_context: The context object for this turn + :type turn_context: :class:`TurnContext` + + :returns: A task that represents the work queued to execute + + .. remarks:: + The `OnTurnAsync` method calls this method when it receives a message activity. + + """ return async def on_conversation_update_activity(self, turn_context: TurnContext): From 1ff4e09de5c969a760b097867c118c5000efdde8 Mon Sep 17 00:00:00 2001 From: Michael Miele Date: Tue, 21 Jan 2020 11:07:42 -0800 Subject: [PATCH 2/4] Update activity_handler.py Added comments to n_conversation_update_activity method --- .../botbuilder/core/activity_handler.py | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/libraries/botbuilder-core/botbuilder/core/activity_handler.py b/libraries/botbuilder-core/botbuilder/core/activity_handler.py index 27b24a3ea..a429894dd 100644 --- a/libraries/botbuilder-core/botbuilder/core/activity_handler.py +++ b/libraries/botbuilder-core/botbuilder/core/activity_handler.py @@ -65,13 +65,31 @@ async def on_message_activity( # pylint: disable=unused-argument :returns: A task that represents the work queued to execute - .. remarks:: - The `OnTurnAsync` method calls this method when it receives a message activity. - """ return async def on_conversation_update_activity(self, turn_context: TurnContext): + """Invoked when a conversation update activity is received from the channel when the base behavior of + `OnTurnAsync` is used. + Conversation update activities are useful when it comes to responding to users being added to or removed from the conversation. + For example, a bot could respond to a user being added by greeting the user. + By default, this method calls :meth:`ActivityHandler.on_members_added_activity()` if any users have been added or + :meth:`ActivityHandler.on_members_removed_activity()` if any users have been removed. + The method checks the member ID so that it only responds to updates regarding members other than the bot itself. + + :param turn_context: The context object for this turn + :type turn_context: :class:`TurnContext` + :returns: A task that represents the work queued to execute + + .. remarks:: + When the :meth:'ActivityHandler.on_turn()` method receives a conversation update activity, it calls this method. + If the conversation update activity indicates that members other than the bot joined the conversation, + it calls the :meth:`ActivityHandler.on_members_added_activity()` method. + If the conversation update activity indicates that members other than the bot left the conversation, + it calls the :meth:`ActivityHandler.on_members_removed_activity()` method. + In a derived class, override this method to add logic that applies to all conversation update activities. + Add logic to apply before the member added or removed logic before the call to this base class method. + """ if ( turn_context.activity.members_added is not None and turn_context.activity.members_added From ee0ec4795e50b3814d45ee06bd321de98609bcb4 Mon Sep 17 00:00:00 2001 From: Michael Miele Date: Tue, 21 Jan 2020 17:06:04 -0800 Subject: [PATCH 3/4] Update activity_handler.py Added remaining ref doc --- .../botbuilder/core/activity_handler.py | 160 ++++++++++++++++-- 1 file changed, 150 insertions(+), 10 deletions(-) diff --git a/libraries/botbuilder-core/botbuilder/core/activity_handler.py b/libraries/botbuilder-core/botbuilder/core/activity_handler.py index a429894dd..9d4bfb6f1 100644 --- a/libraries/botbuilder-core/botbuilder/core/activity_handler.py +++ b/libraries/botbuilder-core/botbuilder/core/activity_handler.py @@ -22,8 +22,8 @@ async def on_turn(self, turn_context: TurnContext): In a derived class, override this method to add logic that applies to all activity types. .. note:: - - Add logic to apply before the type-specific logic and before the call to the base class `OnTurnAsync` method. - - Add logic to apply after the type-specific logic after the call to the base class `OnTurnAsync` method. + - Add logic to apply before the type-specific logic and before the call to the :meth:`ActivityHandler.on_turn()` method. + - Add logic to apply after the type-specific logic after the call to the :meth:`ActivityHandler.on_turn()` method. """ if turn_context is None: raise TypeError("ActivityHandler.on_turn(): turn_context cannot be None.") @@ -69,13 +69,7 @@ async def on_message_activity( # pylint: disable=unused-argument return async def on_conversation_update_activity(self, turn_context: TurnContext): - """Invoked when a conversation update activity is received from the channel when the base behavior of - `OnTurnAsync` is used. - Conversation update activities are useful when it comes to responding to users being added to or removed from the conversation. - For example, a bot could respond to a user being added by greeting the user. - By default, this method calls :meth:`ActivityHandler.on_members_added_activity()` if any users have been added or - :meth:`ActivityHandler.on_members_removed_activity()` if any users have been removed. - The method checks the member ID so that it only responds to updates regarding members other than the bot itself. + """Invoked when a conversation update activity is received from the channel when the base behavior of :meth:`ActivityHandler.on_turn()` is used. :param turn_context: The context object for this turn :type turn_context: :class:`TurnContext` @@ -108,15 +102,63 @@ async def on_conversation_update_activity(self, turn_context: TurnContext): async def on_members_added_activity( self, members_added: List[ChannelAccount], turn_context: TurnContext - ): # pylint: disable=unused-argument + ): # pylint: disable=unused-argument + """Override this method in a derived class to provide logic for when members other than the bot join the conversation. + You can add your bot's welcome logic. + + :param members_added: A list of all the members added to the conversation, as described by the conversation update activity + :type members_added: :class:`typing.List` + :param turn_context: The context object for this turn + :type turn_context: :class:`TurnContext` + + :returns: A task that represents the work queued to execute + + .. remarks:: + When the :meth:'ActivityHandler.on_conversation_update_activity()` method receives a conversation update activity that indicates + one or more users other than the bot are joining the conversation, it calls this method. + """ return async def on_members_removed_activity( self, members_removed: List[ChannelAccount], turn_context: TurnContext ): # pylint: disable=unused-argument + """Override this method in a derived class to provide logic for when members other than the bot leave the conversation. + You can add your bot's good-bye logic. + + :param members_added: A list of all the members removed from the conversation, as described by the conversation update activity + :type members_added: :class:`typing.List` + :param turn_context: The context object for this turn + :type turn_context: :class:`TurnContext` + + :returns: A task that represents the work queued to execute + + .. remarks:: + When the :meth:'ActivityHandler.on_conversation_update_activity()` method receives a conversation update activity that indicates + one or more users other than the bot are leaving the conversation, it calls this method. + """ + return async def on_message_reaction_activity(self, turn_context: TurnContext): + """Invoked when an event activity is received from the connector when the base behavior of :meth:'ActivityHandler.on_turn()` is used. + Message reactions correspond to the user adding a 'like' or 'sad' etc. (often an emoji) to a previously sent activity. + Message reactions are only supported by a few channels. The activity that the message reaction corresponds to is indicated in the + reply to Id property. The value of this property is the activity id of a previously sent activity given back to the bot as the response + from a send call. + + :param turn_context: The context object for this turn + :type turn_context: :class:`TurnContext` + + :returns: A task that represents the work queued to execute + + .. remarks:: + When the :meth:'ActivityHandler.on_turn()` method receives a message reaction activity, it calls this method. + If the message reaction indicates that reactions were added to a message, it calls :meth:'ActivityHandler.on_reaction_added(). + If the message reaction indicates that reactions were removed from a message, it calls :meth:'ActivityHandler.on_reaction_removed(). + In a derived class, override this method to add logic that applies to all message reaction activities. + Add logic to apply before the reactions added or removed logic before the call to the this base class method. + Add logic to apply after the reactions added or removed logic after the call to the this base class method. + """ if turn_context.activity.reactions_added is not None: await self.on_reactions_added( turn_context.activity.reactions_added, turn_context @@ -130,14 +172,68 @@ async def on_message_reaction_activity(self, turn_context: TurnContext): async def on_reactions_added( # pylint: disable=unused-argument self, message_reactions: List[MessageReaction], turn_context: TurnContext ): + """Override this method in a derived class to provide logic for when reactions to a previous activity + are added to the conversation. + + :param message_reactions: The list of reactions added + :type message_reactions: :class:`typing.List` + :param turn_context: The context object for this turn + :type turn_context: :class:`TurnContext` + + :returns: A task that represents the work queued to execute + + .. remarks:: + Message reactions correspond to the user adding a 'like' or 'sad' etc. (often an emoji) + to a previously sent message on the conversation. Message reactions are supported by only a few channels. + The activity that the message is in reaction to is identified by the activity's reply to Id property. + The value of this property is the activity ID of a previously sent activity. When the bot sends an activity, + the channel assigns an ID to it, which is available in the resource response Id of the result. + """ return async def on_reactions_removed( # pylint: disable=unused-argument self, message_reactions: List[MessageReaction], turn_context: TurnContext ): + """Override this method in a derived class to provide logic for when reactions to a previous activity + are removed from the conversation. + + :param message_reactions: The list of reactions removed + :type message_reactions: :class:`typing.List` + :param turn_context: The context object for this turn + :type turn_context: :class:`TurnContext` + + :returns: A task that represents the work queued to execute + + .. remarks:: + Message reactions correspond to the user adding a 'like' or 'sad' etc. (often an emoji) + to a previously sent message on the conversation. Message reactions are supported by only a few channels. + The activity that the message is in reaction to is identified by the activity's reply to Id property. + The value of this property is the activity ID of a previously sent activity. When the bot sends an activity, + the channel assigns an ID to it, which is available in the resource response Id of the result. + """ return async def on_event_activity(self, turn_context: TurnContext): + """Invoked when an event activity is received from the connector when the base behavior of :meth:'ActivityHandler.on_turn()` is used. + + :param turn_context: The context object for this turn + :type turn_context: :class:`TurnContext` + + :returns: A task that represents the work queued to execute + + .. remarks:: + When the :meth:'ActivityHandler.on_turn()` method receives an event activity, it calls this method. + If the activity name is `tokens/response`, it calls :meth:'ActivityHandler.on_token_response_event()`; + otherwise, it calls :meth:'ActivityHandler.on_event()`. + + In a derived class, override this method to add logic that applies to all event activities. + Add logic to apply before the specific event-handling logic before the call to this base class method. + Add logic to apply after the specific event-handling logic after the call to this base class method. + + Event activities communicate programmatic information from a client or channel to a bot. + The meaning of an event activity is defined by the event activity name property, which is meaningful within + the scope of a channel. + """ if turn_context.activity.name == "tokens/response": return await self.on_token_response_event(turn_context) @@ -146,19 +242,63 @@ async def on_event_activity(self, turn_context: TurnContext): async def on_token_response_event( # pylint: disable=unused-argument self, turn_context: TurnContext ): + """Invoked when a `tokens/response` event is received when the base behavior of :meth:'ActivityHandler.on_event_activity()` is used. + If using an `oauth_prompt`, override this method to forward this activity to the current dialog. + + :param turn_context: The context object for this turn + :type turn_context: :class:`TurnContext` + + :returns: A task that represents the work queued to execute + + .. remarks:: + When the :meth:'ActivityHandler.on_event()` method receives an event with an activity name of `tokens/response`, + it calls this method. If your bot uses an `oauth_prompt`, forward the incoming activity to the current dialog. + """ return async def on_event( # pylint: disable=unused-argument self, turn_context: TurnContext ): + """Invoked when an event other than `tokens/response` is received when the base behavior of + :meth:'ActivityHandler.on_event_activity()` is used. + This method could optionally be overridden if the bot is meant to handle miscellaneous events. + + :param turn_context: The context object for this turn + :type turn_context: :class:`TurnContext` + + :returns: A task that represents the work queued to execute + + .. remarks:: + When the :meth:'ActivityHandler.on_event_activity()` is used method receives an event with an + activity name other than `tokens/response`, it calls this method. + """ return async def on_end_of_conversation_activity( # pylint: disable=unused-argument self, turn_context: TurnContext ): + """Invoked when a conversation end activity is received from the channel. + + :param turn_context: The context object for this turn + :type turn_context: :class:`TurnContext` + :returns: A task that represents the work queued to execute + """ return async def on_unrecognized_activity_type( # pylint: disable=unused-argument self, turn_context: TurnContext ): + """Invoked when an activity other than a message, conversation update, or event is received when the base behavior of + :meth:`ActivityHandler.on_turn()` is used. + If overridden, this method could potentially respond to any of the other activity types. + + :param turn_context: The context object for this turn + :type turn_context: :class:`TurnContext` + + :returns: A task that represents the work queued to execute + + .. remarks:: + When the :meth:`ActivityHandler.on_turn()` method receives an activity that is not a message, conversation update, message reaction, + or event activity, it calls this method. + """ return From 5e36083cecf04cae87175a6be0647c90cd4b82bd Mon Sep 17 00:00:00 2001 From: Michael Miele Date: Fri, 24 Jan 2020 16:26:41 -0800 Subject: [PATCH 4/4] Update activity_handler.py Code comments formatting.and repplaced remarks with note in methods. --- .../botbuilder/core/activity_handler.py | 92 +++++++++++-------- 1 file changed, 54 insertions(+), 38 deletions(-) diff --git a/libraries/botbuilder-core/botbuilder/core/activity_handler.py b/libraries/botbuilder-core/botbuilder/core/activity_handler.py index 9d4bfb6f1..54a16c056 100644 --- a/libraries/botbuilder-core/botbuilder/core/activity_handler.py +++ b/libraries/botbuilder-core/botbuilder/core/activity_handler.py @@ -8,22 +8,23 @@ class ActivityHandler: async def on_turn(self, turn_context: TurnContext): - """ Called by the adapter (for example, :class:`BotFrameworkAdapter`) at runtime + """ + Called by the adapter (for example, :class:`BotFrameworkAdapter`) at runtime in order to process an inbound :class:`botbuilder.schema.Activity`. - :param turn_context: The context object for this turn - :type turn_context: :class:`TurnContext` + :param turn_context: The context object for this turn + :type turn_context: :class:`TurnContext` - :returns: A task that represents the work queued to execute + :returns: A task that represents the work queued to execute - .. remarks:: - It calls other methods in this class based on the type of the activity to - process, which allows a derived class to provide type-specific logic in a controlled way. - In a derived class, override this method to add logic that applies to all activity types. + .. remarks:: + It calls other methods in this class based on the type of the activity to + process, which allows a derived class to provide type-specific logic in a controlled way. + In a derived class, override this method to add logic that applies to all activity types. - .. note:: - - Add logic to apply before the type-specific logic and before the call to the :meth:`ActivityHandler.on_turn()` method. - - Add logic to apply after the type-specific logic after the call to the :meth:`ActivityHandler.on_turn()` method. + .. note:: + - Add logic to apply before the type-specific logic and before the call to the :meth:`ActivityHandler.on_turn()` method. + - Add logic to apply after the type-specific logic after the call to the :meth:`ActivityHandler.on_turn()` method. """ if turn_context is None: raise TypeError("ActivityHandler.on_turn(): turn_context cannot be None.") @@ -57,7 +58,8 @@ async def on_turn(self, turn_context: TurnContext): async def on_message_activity( # pylint: disable=unused-argument self, turn_context: TurnContext ): - """Override this method in a derived class to provide logic specific to activities, + """ + Override this method in a derived class to provide logic specific to activities, such as the conversational logic. :param turn_context: The context object for this turn @@ -69,13 +71,15 @@ async def on_message_activity( # pylint: disable=unused-argument return async def on_conversation_update_activity(self, turn_context: TurnContext): - """Invoked when a conversation update activity is received from the channel when the base behavior of :meth:`ActivityHandler.on_turn()` is used. + """ + Invoked when a conversation update activity is received from the channel when the base behavior of :meth:`ActivityHandler.on_turn()` is used. :param turn_context: The context object for this turn :type turn_context: :class:`TurnContext` + :returns: A task that represents the work queued to execute - .. remarks:: + .. note:: When the :meth:'ActivityHandler.on_turn()` method receives a conversation update activity, it calls this method. If the conversation update activity indicates that members other than the bot joined the conversation, it calls the :meth:`ActivityHandler.on_members_added_activity()` method. @@ -103,7 +107,8 @@ async def on_conversation_update_activity(self, turn_context: TurnContext): async def on_members_added_activity( self, members_added: List[ChannelAccount], turn_context: TurnContext ): # pylint: disable=unused-argument - """Override this method in a derived class to provide logic for when members other than the bot join the conversation. + """ + Override this method in a derived class to provide logic for when members other than the bot join the conversation. You can add your bot's welcome logic. :param members_added: A list of all the members added to the conversation, as described by the conversation update activity @@ -113,7 +118,7 @@ async def on_members_added_activity( :returns: A task that represents the work queued to execute - .. remarks:: + .. note:: When the :meth:'ActivityHandler.on_conversation_update_activity()` method receives a conversation update activity that indicates one or more users other than the bot are joining the conversation, it calls this method. """ @@ -122,7 +127,8 @@ async def on_members_added_activity( async def on_members_removed_activity( self, members_removed: List[ChannelAccount], turn_context: TurnContext ): # pylint: disable=unused-argument - """Override this method in a derived class to provide logic for when members other than the bot leave the conversation. + """ + Override this method in a derived class to provide logic for when members other than the bot leave the conversation. You can add your bot's good-bye logic. :param members_added: A list of all the members removed from the conversation, as described by the conversation update activity @@ -132,7 +138,7 @@ async def on_members_removed_activity( :returns: A task that represents the work queued to execute - .. remarks:: + .. note:: When the :meth:'ActivityHandler.on_conversation_update_activity()` method receives a conversation update activity that indicates one or more users other than the bot are leaving the conversation, it calls this method. """ @@ -140,18 +146,20 @@ async def on_members_removed_activity( return async def on_message_reaction_activity(self, turn_context: TurnContext): - """Invoked when an event activity is received from the connector when the base behavior of :meth:'ActivityHandler.on_turn()` is used. - Message reactions correspond to the user adding a 'like' or 'sad' etc. (often an emoji) to a previously sent activity. - Message reactions are only supported by a few channels. The activity that the message reaction corresponds to is indicated in the - reply to Id property. The value of this property is the activity id of a previously sent activity given back to the bot as the response - from a send call. + """ + Invoked when an event activity is received from the connector when the base behavior of :meth:'ActivityHandler.on_turn()` is used. + :param turn_context: The context object for this turn :type turn_context: :class:`TurnContext` :returns: A task that represents the work queued to execute - .. remarks:: + .. note:: + Message reactions correspond to the user adding a 'like' or 'sad' etc. (often an emoji) to a previously sent activity. + Message reactions are only supported by a few channels. The activity that the message reaction corresponds to is indicated in the + reply to Id property. The value of this property is the activity id of a previously sent activity given back to the bot as the response + from a send call. When the :meth:'ActivityHandler.on_turn()` method receives a message reaction activity, it calls this method. If the message reaction indicates that reactions were added to a message, it calls :meth:'ActivityHandler.on_reaction_added(). If the message reaction indicates that reactions were removed from a message, it calls :meth:'ActivityHandler.on_reaction_removed(). @@ -172,7 +180,8 @@ async def on_message_reaction_activity(self, turn_context: TurnContext): async def on_reactions_added( # pylint: disable=unused-argument self, message_reactions: List[MessageReaction], turn_context: TurnContext ): - """Override this method in a derived class to provide logic for when reactions to a previous activity + """ + Override this method in a derived class to provide logic for when reactions to a previous activity are added to the conversation. :param message_reactions: The list of reactions added @@ -182,7 +191,7 @@ async def on_reactions_added( # pylint: disable=unused-argument :returns: A task that represents the work queued to execute - .. remarks:: + .. note:: Message reactions correspond to the user adding a 'like' or 'sad' etc. (often an emoji) to a previously sent message on the conversation. Message reactions are supported by only a few channels. The activity that the message is in reaction to is identified by the activity's reply to Id property. @@ -194,7 +203,8 @@ async def on_reactions_added( # pylint: disable=unused-argument async def on_reactions_removed( # pylint: disable=unused-argument self, message_reactions: List[MessageReaction], turn_context: TurnContext ): - """Override this method in a derived class to provide logic for when reactions to a previous activity + """ + Override this method in a derived class to provide logic for when reactions to a previous activity are removed from the conversation. :param message_reactions: The list of reactions removed @@ -204,7 +214,7 @@ async def on_reactions_removed( # pylint: disable=unused-argument :returns: A task that represents the work queued to execute - .. remarks:: + .. note:: Message reactions correspond to the user adding a 'like' or 'sad' etc. (often an emoji) to a previously sent message on the conversation. Message reactions are supported by only a few channels. The activity that the message is in reaction to is identified by the activity's reply to Id property. @@ -214,14 +224,15 @@ async def on_reactions_removed( # pylint: disable=unused-argument return async def on_event_activity(self, turn_context: TurnContext): - """Invoked when an event activity is received from the connector when the base behavior of :meth:'ActivityHandler.on_turn()` is used. + """ + Invoked when an event activity is received from the connector when the base behavior of :meth:'ActivityHandler.on_turn()` is used. :param turn_context: The context object for this turn :type turn_context: :class:`TurnContext` :returns: A task that represents the work queued to execute - .. remarks:: + .. note:: When the :meth:'ActivityHandler.on_turn()` method receives an event activity, it calls this method. If the activity name is `tokens/response`, it calls :meth:'ActivityHandler.on_token_response_event()`; otherwise, it calls :meth:'ActivityHandler.on_event()`. @@ -242,7 +253,8 @@ async def on_event_activity(self, turn_context: TurnContext): async def on_token_response_event( # pylint: disable=unused-argument self, turn_context: TurnContext ): - """Invoked when a `tokens/response` event is received when the base behavior of :meth:'ActivityHandler.on_event_activity()` is used. + """ + Invoked when a `tokens/response` event is received when the base behavior of :meth:'ActivityHandler.on_event_activity()` is used. If using an `oauth_prompt`, override this method to forward this activity to the current dialog. :param turn_context: The context object for this turn @@ -250,7 +262,7 @@ async def on_token_response_event( # pylint: disable=unused-argument :returns: A task that represents the work queued to execute - .. remarks:: + .. note:: When the :meth:'ActivityHandler.on_event()` method receives an event with an activity name of `tokens/response`, it calls this method. If your bot uses an `oauth_prompt`, forward the incoming activity to the current dialog. """ @@ -259,25 +271,28 @@ async def on_token_response_event( # pylint: disable=unused-argument async def on_event( # pylint: disable=unused-argument self, turn_context: TurnContext ): - """Invoked when an event other than `tokens/response` is received when the base behavior of + """ + Invoked when an event other than `tokens/response` is received when the base behavior of :meth:'ActivityHandler.on_event_activity()` is used. - This method could optionally be overridden if the bot is meant to handle miscellaneous events. + :param turn_context: The context object for this turn :type turn_context: :class:`TurnContext` :returns: A task that represents the work queued to execute - .. remarks:: + .. note:: When the :meth:'ActivityHandler.on_event_activity()` is used method receives an event with an activity name other than `tokens/response`, it calls this method. + This method could optionally be overridden if the bot is meant to handle miscellaneous events. """ return async def on_end_of_conversation_activity( # pylint: disable=unused-argument self, turn_context: TurnContext ): - """Invoked when a conversation end activity is received from the channel. + """ + Invoked when a conversation end activity is received from the channel. :param turn_context: The context object for this turn :type turn_context: :class:`TurnContext` @@ -288,7 +303,8 @@ async def on_end_of_conversation_activity( # pylint: disable=unused-argument async def on_unrecognized_activity_type( # pylint: disable=unused-argument self, turn_context: TurnContext ): - """Invoked when an activity other than a message, conversation update, or event is received when the base behavior of + """ + Invoked when an activity other than a message, conversation update, or event is received when the base behavior of :meth:`ActivityHandler.on_turn()` is used. If overridden, this method could potentially respond to any of the other activity types. @@ -297,7 +313,7 @@ async def on_unrecognized_activity_type( # pylint: disable=unused-argument :returns: A task that represents the work queued to execute - .. remarks:: + .. note:: When the :meth:`ActivityHandler.on_turn()` method receives an activity that is not a message, conversation update, message reaction, or event activity, it calls this method. """