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

chat.post_message() arguments does not match SlackApi arguments #83

Closed
Lex45x opened this issue Oct 7, 2016 · 3 comments
Closed

chat.post_message() arguments does not match SlackApi arguments #83

Lex45x opened this issue Oct 7, 2016 · 3 comments

Comments

@Lex45x
Copy link

Lex45x commented Oct 7, 2016

I was faced with next problem:
When I try to send message with attachments and without text I'm catching exception
But Slack provides sending message with empty text and attachments, as you can see picture below
image
Hope you fix that:)

@tomdownes14
Copy link

You can provide a string with just a space as the text field, which is then overridden by your attachments. I've done this and had no issues.

@nmavor
Copy link

nmavor commented Oct 11, 2016

HI
i just test it and its not looking as working
the code is :

from slacker import Slacker

slack = Slacker(properties.slack_key)
MSG = '[{title:"cnn site", title_link:"http://cnn.com"}]'
slack.chat.post_message(channel='test',attachments=MSG,text=' ')

i did test full json but its not working in geting clear text in the slack

@JWSong
Copy link

JWSong commented Oct 19, 2016

You must put a wrong-formatted attachment. If a wrong-formatted attachment sent to API, it is ignored so that the 'text' field is required. Check your attachment format and do not forget set the argument 'text' to None.

@os os closed this as completed in 1f53e65 Jan 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants