HubSpot / slack-client

An asynchronous HTTP client for Slack's web API
Apache License 2.0
115 stars 53 forks source link

Don`t include as_user param in chat.postEphemeral request if it is empty #201

Closed zmarushchak-hs closed 4 years ago

zmarushchak-hs commented 4 years ago

V2 Slack app doesn't support as_user param for chat.postEphemeral method.
Here is the error:

{
  "ok" : false,
  "error" : "invalid_arguments",
  "deprecated_argument" : "as_user",
  "warning" : "missing_charset",
  "response_metadata" : {
    "warnings" : [ "missing_charset" ]
  }

This PR adds annotation to not include as_user param if it's value is not present. It'll be treated as false in such case.

Please see also: https://api.slack.com/authentication/quickstart#calling