Skip to content

Add support for nested structure, e.g. attachments#100

Merged
Yasumoto merged 5 commits intoslackapi:masterfrom
greut:nested
Jul 1, 2016
Merged

Add support for nested structure, e.g. attachments#100
Yasumoto merged 5 commits intoslackapi:masterfrom
greut:nested

Conversation

@greut
Copy link
Copy Markdown
Contributor

@greut greut commented Jun 1, 2016

The optional attachments argument should contain a JSON-encoded array of attachments.

https://api.slack.com/methods/chat.postMessage

This enables simpler calls like this:

sc.api_call('chat.postMessage', {'attachments': [{'title': 'hello'}]})
# instead of
sc.api_call('chat.postMessage', {'attachments': json.dumps([{'title': 'hello'}]}))

@greut
Copy link
Copy Markdown
Contributor Author

greut commented Jun 7, 2016

Damn... it took me one week to realize the bugs I've introduced. I was probably too tired to see anything.

@coveralls
Copy link
Copy Markdown

coveralls commented Jun 7, 2016

Coverage Status

Coverage decreased (-0.002%) to 60.082% when pulling 6011119 on greut:nested into 87261f4 on slackhq:master.

@coveralls
Copy link
Copy Markdown

coveralls commented Jun 7, 2016

Coverage Status

Coverage increased (+0.2%) to 60.246% when pulling eb57cb5 on greut:nested into 87261f4 on slackhq:master.

@greut greut mentioned this pull request Jun 7, 2016
@coveralls
Copy link
Copy Markdown

coveralls commented Jun 14, 2016

Coverage Status

Coverage increased (+0.3%) to 60.408% when pulling ebd1fd3 on greut:nested into 87261f4 on slackhq:master.

greut added 3 commits June 27, 2016 08:43
> The optional attachments argument should contain a JSON-encoded array of
> attachments.
>
> https://api.slack.com/methods/chat.postMessage

This enables simpler calls like this:

    sc.api_call('chat.postMessage', {'attachments': [{'title': 'hello'}]})
* `six` is already required by websocket-client so it doesn't add much
  weight to the overall installation.
@coveralls
Copy link
Copy Markdown

coveralls commented Jun 27, 2016

Coverage Status

Coverage increased (+0.5%) to 60.408% when pulling 13f4373 on greut:nested into 4fc299f on slackhq:master.

@moos3
Copy link
Copy Markdown

moos3 commented Jun 30, 2016

Any chance of getting this merged in?

Comment thread setup.py
install_requires=[
'websocket-client',
'requests',
'six',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind adding six to requirements.txt as well?

@Yasumoto
Copy link
Copy Markdown
Contributor

Yasumoto commented Jul 1, 2016

This is great! If you also don't mind updating the documentation to ensure other users know this exists, that'd be really helpful.

Normally I'd also ask you to add test coverage, but we don't have any good examples quite yet! If you're familiar with responses and don't mind adding test cases that'd be great, otherwise you can skip 'em for this PR and I'll add tests after this gets merged.

@coveralls
Copy link
Copy Markdown

coveralls commented Jul 1, 2016

Coverage Status

Coverage increased (+1.3%) to 61.224% when pulling bcf0a5f on greut:nested into 4fc299f on slackhq:master.

@greut
Copy link
Copy Markdown
Contributor Author

greut commented Jul 1, 2016

@Yasumoto sure, there you go. Travis seems to fail with coveralls.

As of responses, I care about what's send to Slack rather than having to deal with Slack's responses.

Cheers,

@coveralls
Copy link
Copy Markdown

coveralls commented Jul 1, 2016

Coverage Status

Coverage increased (+1.3%) to 61.224% when pulling 5ab1954 on greut:nested into 4fc299f on slackhq:master.

@Yasumoto Yasumoto merged commit fc21a03 into slackapi:master Jul 1, 2016
@Yasumoto
Copy link
Copy Markdown
Contributor

Yasumoto commented Jul 1, 2016

Thanks so much @greut !

@greut
Copy link
Copy Markdown
Contributor Author

greut commented Jul 1, 2016

@Yasumoto my pleasure. Congrats on your new job at SlackHQ.

c-goosen pushed a commit to c-goosen/python-slackclient that referenced this pull request Jun 18, 2019
Add support for nested structure, e.g. attachments
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

Successfully merging this pull request may close these issues.

4 participants