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

Slack-Node use deprecated attributes when posting messages. #652

Closed
trygvis opened this issue Jun 10, 2020 · 4 comments
Closed

Slack-Node use deprecated attributes when posting messages. #652

trygvis opened this issue Jun 10, 2020 · 4 comments

Comments

@trygvis
Copy link

trygvis commented Jun 10, 2020

Describe the bug

The as_user flag for the "post message" request is deprecated and can't be included if the user is using bot tokens. If it is included this is returned from Slack:

ok error deprecated_argument
false invalid_arguments as_user

https://api.slack.com/methods/chat.postMessage#arg_as_user

To Reproduce

Try to send a message with Authentication=Access Token and use a Bot token.

Environment (please complete the following information):

  • n8n Version HEAD form master.

Additional context

If I add delete body.as_user at line 456 of Slack.node.ts the message is posted as my bot user.

A proper fix I think would be to remove the as_user entirely.

@RicardoE105
Copy link
Contributor

Hey, @trygvis thanks for putting that together. I will check and keep you updated.

RicardoE105 added a commit to RicardoE105/n8n that referenced this issue Jun 15, 2020
@RicardoE105
Copy link
Contributor

@trygvis Just sent a PR fixing this, will let you know when is released. Again, Thanks.

RicardoE105 added a commit to RicardoE105/n8n that referenced this issue Jun 15, 2020
janober pushed a commit that referenced this issue Jun 20, 2020
* 🐛 Fixes issue #651 and #652

* ⚡ Added description to username field
@janober
Copy link
Member

janober commented Jun 25, 2020

Fix got released with n8n@0.71.0

@janober janober closed this as completed Jun 25, 2020
@inn0kenty
Copy link
Contributor

The as_user parameter may not be used with newer bot tokens. But still, it may be used with user tokens. This fix broken this possibility.

The as_user with user token works fine in 0.70.0.

So, I suppose we should delete as_user from a request body only when it false. In this case, bot tokens and as_user with user tokens will be work.

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

4 participants