8000 15.handling-attachments suggested corrections · itsmokha/botbuilder-python@3c0ad15 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3c0ad15

Browse files
author
Tracy Boehrer
committed
15.handling-attachments suggested corrections
1 parent 0b17bde commit 3c0ad15

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

samples/15.handling-attachments/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525

2626
# Catch-all for errors.
27-
async def on_error(self, context: TurnContext, error: Exception):
27+
async def on_error(context: TurnContext, error: Exception):
2828
# This check writes out errors to console log .vs. app insights.
2929
# NOTE: In production environment, you should consider logging this to Azure
3030
# application insights.
@@ -47,7 +47,7 @@ async def on_error(self, context: TurnContext, error: Exception):
4747
# Send a trace activity, which will be displayed in Bot Framework Emulator
4848
await context.send_activity(trace_activity)
4949

50-
ADAPTER.on_turn_error = MethodType(on_error, ADAPTER)
50+
ADAPTER.on_turn_error = on_error
5151

5252
# Create the Bot
5353
BOT = AttachmentsBot()

samples/15.handling-attachments/bots/attachments_bot.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,9 @@ async def _get_upload_attachment(self, turn_context: TurnContext) -> Attachment:
193193
)
194194

195195
base_uri: str = connector.config.base_url
196-
attachment_uri = \
197-
base_uri \
198-
+ ("" if base_uri.endswith("/") else "/") \
199-
+ f"v3/attachments/{response.id}/views/original"
196+
attachment_uri = (base_uri
197+
+ ("" if base_uri.endswith("/") else "/")
198+
+ f"v3/attachments/{response.id}/views/original")
200199

201200
return Attachment(
202201
name="architecture-resize.png",

0 commit comments

Comments
 (0)
0