Inumedia / SlackAPI

.NET Implementation of the Slack team communication platform API.
MIT License
452 stars 243 forks source link

Unable to update a message using UpdateAsync #263

Open farhanalam opened 3 years ago

farhanalam commented 3 years ago

Here is my code

var slackClient = new SlackTaskClient(token);
var postResponse = await slackClient.PostMessageAsync("#general", "test");
var updateResponse = await slackClient.UpdateAsync(postResponse.ts, "#general", "test 2.0");

The response I get (as observed in Fiddler) is

{"ok":false,"error":"invalid_arguments","deprecated_argument":"as_user"}

I believe this requires a similar fix to https://github.com/Inumedia/SlackAPI/issues/217

VladyslavLishchyna commented 3 years ago

try get channel from postResponse and put it to UpdateAsync override #general its works for me)

xt0rted commented 3 years ago

I just ran into this issue and was able to get it to work by setting as_user: true on the update method. This shows the message as edited though, which other integrations don't seem to do 🤷‍♂️