question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Activity.Text is set to filename and not the message text when sending a Slack message with attachment

See original GitHub issue

Version

What package version of the SDK are you using. 4.10.3

Describe the bug

When sending a message in Slack with an attachment, the turnContext.Activity.Text property is populated with the file name and not the message text.

To Reproduce

Steps to reproduce the behavior:

  1. Create a bot and connect it to Slack using Azure Bot Service.
  2. In Slack, type a message that also includes an attachment.
  3. Check out the properties of turnContext in OnMessageActivityAsync

Expected behavior

Expected that turnContext.Activity.Text is populated with the Slack message (“hey there, here’s an attachment” in the screenshot.) Actual: turnContext.Activity.Text is populated with the file name of the uploaded attachment.

Screenshots

Screen Shot 2020-10-29 at 8 45 06 PM

Additional context

I can see the message in ChannelData, but I think the current behavior is incorrect. Text should be the message. It’s already possible to get the attachment filename via the Attachments property. For example, if I attach multiple files, the Text property is populated with just one of those file names.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mrivera-mscommented, Feb 8, 2021

@v-kydela, I have created a separate Issue 280 to track the fix in ABS. Adding @arturl , @craigjensen @bwamie for visibility. Also, moving this issue out of the R12 release.

1reaction
compulimcommented, Feb 19, 2021

Looks like there is an ongoing effort on fixing this bug. I am exempting it from DRI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reference: Secondary message attachments
Field Description Block alternatives author_name Small text used to display the author's name. A text object in a context block. title Large title text near...
Read more >
files.upload method
Upload files and images into message threads by providing the thread parent's ts value with the thread_ts parameter. The initial_comment field is used...
Read more >
Uploading files using the Slack Python SDK
Let's try uploading a file using text supplied to the content parameter. This will upload a text file with the specified content ....
Read more >
Creating rich message layouts
Creating rich message layouts. Structure complex data in an easily readable and understandable way within messages. Message text formatting can improve ...
Read more >
Manage message activity
From your desktop, click your workspace name in the top left. · Click Settings & administration, then select Workspace settings. · Click the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found