Using version 1.0.1 of SlackMessageBuilder.SystemTextJson, I receive the following error when posting a SlackApiMessage that is built with any of the WithUsername / WIthIconUrl/ WithIconEmoji methods (all of these methods use setters that also set as_user = false) : {"ok":false,"error":"invalid_arguments","deprecated_argument":"as_user"}
The message is posted to the the Slack API /api/chat.postMessage - authenticating using a bot token with granular permissions.
Using version 1.0.1 of
SlackMessageBuilder.SystemTextJson
, I receive the following error when posting a SlackApiMessage that is built with any of theWithUsername
/WIthIconUrl
/WithIconEmoji
methods (all of these methods use setters that also setas_user = false
) :{"ok":false,"error":"invalid_arguments","deprecated_argument":"as_user"}
The message is posted to the the Slack API/api/chat.postMessage
- authenticating using a bot token with granular permissions.As far as I can understand from https://api.slack.com/methods/chat.postMessage#legacy_authorship , the
as_user
parameter is only supported for classic slack apps (and webhooks?). There's a similar ticket in the BotKit library, which uses the same api for posting messages - https://github.com/howdyai/botkit/issues/1943 , which they fixed through https://github.com/howdyai/botkit/pull/1944/filesAdditionally, if upgrading to version 1.1.2 of the package, serialization of such messages fails due to the
post_at
field name being used for both theUsername
andPostAt
properties: https://github.com/lantean-code/SlackMessageBuilder/blame/18ad8915a3e36fa2efa0fc5a7b5b484ffcc16cc7/SlackMessageBuilder/Objects/SlackApiMessage.cs#L179