Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unfurl_links does not work again #1231

Open
gringus opened this issue Sep 27, 2023 · 0 comments
Open

unfurl_links does not work again #1231

gringus opened this issue Sep 27, 2023 · 0 comments

Comments

@gringus
Copy link

gringus commented Sep 27, 2023

What happened

When creating message parameters and setting UnfurlMedia to false attribute is actually not set as it's equal to the default value. According to Slack documentation:

By default, we unfurl all links in any messages posted by users and Slack apps. This applies to messages posted via incoming webhooks, chat.postMessage and chat.postEphemeral.

Expected behaviour

No user profile should be attached to a posted message.

Steps to reproduce

  1. Create a new Slack channel
  2. Post a message (PostMessage) with a link to a user profile (eg. <https://example.slack.com/team/XXXXXXXXXX|Some user>) to that channel with UnfurlLinks set to false
  3. In the debug log entry we can observe that unfurl_links was not sent to Slack eg.
slack-go/slack2023/09/26 16:21:17 chat.go:228: Sending request: channel=%23test&mrkdwn=false&text=%3Chttps%3A%2F%2Fexample.slack.com%2Fteam%2FXXXXXXXXXX%7CSome+user%3E&token=xoxb-REDACTED&unfurl_media=false&username=User

This is related to #20 when the default value was changed to false. Forcing to send UnfurlLinks (by using MsgOptionDisableLinkUnfurl()) solves the problem.

Versions

  • Go: 1.21.0
  • slack-go/slack: 0.12.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant