Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chat.postMessage checkResponse() failed "invalid_arguments" #11

Closed
LinuxRocks2000 opened this issue Dec 6, 2020 · 4 comments
Closed

Comments

@LinuxRocks2000
Copy link

Why is this error happening? Do I need to add something else?
My code:

#include <slacking/slacking.hpp>
#define TEST
#include "secret.h"

int main(){
    auto& slack = slack::create(SECRET);
    slack.chat.channel="#general";
    slack.chat.postMessage("Ding dong man, ding dong. Ding dong, yo, ding dong.");
    return 0;
}
@avpcan
Copy link

avpcan commented Mar 1, 2021

I was getting this, too. I tried editing the slacking.hpp to be in verbose mode and found that this is the error:
{"deprecated_argument":"as_user","error":"invalid_arguments","ok":false}

The error is because slack deprecated the use of as_user for chat.postMessage for new slack apps.

In my case, I actually wanted to use webhooks ( Here's how to set up a webhook )
With webhooks, this is the example to base your code on, and this approach is working for me.

@coin-au-carre
Copy link
Owner

Hello, thanks for the issue and the workaround.
I will try to work on an update for Slacking :).

@coin-au-carre
Copy link
Owner

This PR should fix the issue and you will be able to use postMessage as before !

#12

Indeed, the "as_user" is now deprecated, I just removed it from slacking.hpp.

@coin-au-carre
Copy link
Owner

And sorry for the late reply guys!

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

No branches or pull requests

3 participants