1313
1414from . import __version__
1515from .bot_adapter import BotAdapter
16- from .bot_context import BotContext
16+ from .turn_context import TurnContext
1717
1818USER_AGENT = f"Microsoft-BotFramework/3.1 (BotBuilder Python/{ __version__ } )"
1919
@@ -42,7 +42,7 @@ async def continue_conversation(self, reference: ConversationReference, logic):
4242 :param logic:
4343 :return:
4444 """
45- request = BotContext .apply_conversation_reference (Activity (), reference , is_incoming = True )
45+ request = TurnContext .apply_conversation_reference (Activity (), reference , is_incoming = True )
4646 context = self .create_context (request )
4747 return await self .run_middleware (context , logic )
4848
@@ -63,7 +63,7 @@ async def create_conversation(self, reference: ConversationReference, logic):
6363 client = self .create_connector_client (reference .service_url )
6464
6565 resource_response = await client .conversations .create_conversation_async (parameters )
66- request = BotContext .apply_conversation_reference (Activity (), reference , is_incoming = True )
66+ request = TurnContext .apply_conversation_reference (Activity (), reference , is_incoming = True )
6767 request .conversation = ConversationAccount (id = resource_response .id )
6868 if resource_response .service_url :
6969 request .service_url = resource_response .service_url
@@ -107,7 +107,7 @@ def create_context(self, activity):
107107 :param activity:
108108 :return:
109109 """
110- return BotContext (self , activity )
110+ return TurnContext (self , activity )
111111
112112 @staticmethod
113113 async def parse_request (req ):
@@ -148,7 +148,7 @@ async def validate_activity(activity: Activity):
148148 if is_valid_activity :
149149 return req
150150
151- async def update_activity (self , context : BotContext , activity : Activity ):
151+ async def update_activity (self , context : TurnContext , activity : Activity ):
152152 """
153153 Replaces an activity that was previously sent to a channel. It should be noted that not all
154154 channels support this feature.
@@ -165,7 +165,7 @@ async def update_activity(self, context: BotContext, activity: Activity):
165165 except Exception as e :
166166 raise e
167167
168- async def delete_activity (self , context : BotContext , conversation_reference : ConversationReference ):
168+ async def delete_activity (self , context : TurnContext , conversation_reference : ConversationReference ):
169169 """
170170 Deletes an activity that was previously sent to a channel. It should be noted that not all
171171 channels support this feature.
@@ -180,7 +180,7 @@ async def delete_activity(self, context: BotContext, conversation_reference: Con
180180 except Exception as e :
181181 raise e
182182
183- async def send_activities (self , context : BotContext , activities : List [Activity ]):
183+ async def send_activities (self , context : TurnContext , activities : List [Activity ]):
184184 try :
185185 for activity in activities :
186186 if activity .type == 'delay' :
@@ -198,7 +198,7 @@ async def send_activities(self, context: BotContext, activities: List[Activity])
198198 except Exception as e :
199199 raise e
200200
201- async def delete_conversation_member (self , context : BotContext , member_id : str ) -> None :
201+ async def delete_conversation_member (self , context : TurnContext , member_id : str ) -> None :
202202 """
203203 Deletes a member from the current conversation.
204204 :param context:
@@ -220,7 +220,7 @@ async def delete_conversation_member(self, context: BotContext, member_id: str)
220220 except Exception as e :
221221 raise e
222222
223- async def get_activity_members (self , context : BotContext , activity_id : str ):
223+ async def get_activity_members (self , context : TurnContext , activity_id : str ):
224224 """
225225 Lists the members of a given activity.
226226 :param context:
@@ -244,7 +244,7 @@ async def get_activity_members(self, context: BotContext, activity_id: str):
244244 except Exception as e :
245245 raise e
246246
247- async def get_conversation_members (self , context : BotContext ):
247+ async def get_conversation_members (self , context : TurnContext ):
248248 """
249249 Lists the members of a current conversation.
250250 :param context:
0 commit comments