aki017 / slack-ruby-gem

A Ruby wrapper for the Slack API
MIT License
242 stars 79 forks source link

:text is not a required argument #51

Closed SirRawlins closed 7 years ago

SirRawlins commented 7 years ago

Morning Folks,

Trying to post a chat message through the gem, without :text, using :attachments instead, but receiving an exception ArgumentError: Required arguments :text missing

The API in fact allows you to pass either or both :text and :attachments.

https://github.com/slackhq/slack-api-docs/issues/41

We need to look at the argument validation for chat_postMessage method.

Happy to send a PR in if someone confirms it's a change we want to make.

Thanks,

Rob

aki017 commented 7 years ago

This is also upstream issue. official document say it is require arguments but on description.

This field is usually required, unless you're providing only attachments instead. https://api.slack.com/methods/chat.postMessage

Source code is generated by Required column. and cannot process description column. So need to write special case on https://github.com/aki017/slack-ruby-gem/blob/05d4e65689e506c9b47bc8edc6025176d605384e/lib/generators/templates/method.rb.erb#L25