Skip to content
This repository was archived by the owner on Jul 3, 2020. It is now read-only.
This repository was archived by the owner on Jul 3, 2020. It is now read-only.

Unfurl uploaded image does not work #121

Open

Description

@reisenmachtfreude

Uploading and sharing an image does only work partially:
The message is created in the channel. The linked title shows the picture if I click it.
However, the picture itself is not shown directly in the message as well as the private file is not listed as "shared file" in the slack web interface. Instead it is listed as private file and I can share it manually which works fine.

I'm using the following code:

_self.slack = Slacker()
...
  res = _self.slack.files.upload(filename,channels=_self.slack.channels.get_channel_id('#general'))
  resParsed = json.loads(str(res))
  url = resParsed["file"]["url_private"]
  attachments = [{"title": "Overview", "title_link": url, "text":"test", "image_url":url}]
  _self.slack.chat.post_message("#general", "Overview",as_user=True,  attachments=attachments)

Please help.

Activity

  1. reisenmachtfreude commented on Oct 29, 2017

    @reisenmachtfreude
    Author

    After endless tries my conclusion is that there must be a bug.

    I've solved the problem by switching to https://github.com/slackapi/python-slackclient
    Here the issue was solve within a minute, because I only need to upload the file
    slack.api_call('files.upload', channels='#general', filename='pic.png', file=open(filename, 'rb'))
    In the slack channel the new upload is mentioned automatically and it's content is unfurled.

  2. changed the title [-]Share uploaded image does not work[/-] [+]Unfurl uploaded image does not work[/+] on Oct 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions