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

/webhooks/:id/:token/slack ignores wait query parameter #1067

Closed
vladfrangu opened this issue Aug 13, 2019 · 3 comments
Closed

/webhooks/:id/:token/slack ignores wait query parameter #1067

vladfrangu opened this issue Aug 13, 2019 · 3 comments

Comments

@vladfrangu
Copy link
Contributor

vladfrangu commented Aug 13, 2019

Attempting to send a message through a webhook on the slack path ignores the wait parameter, and always returns "ok"

curl --request POST \
  --url https://canary.discordapp.com/api/webhooks/:id/:token/slack?wait=true \
  --header 'content-type: application/json' \
  --data '{
  "username": "Test123",
  "attachments": [{
    "pretext": "this looks pretty cool",
    "color": "#F0F",
    "footer": "This is a test",
    "ts": 1565708994
  }]
}'

Per the docs, waits for server confirmation of message send before response (defaults to true; when false a message that is not saved does not return an error)

@night
Copy link
Member

night commented Aug 13, 2019

wait defaults to true on the Slack endpoint to ensure compatibility with Slack integrations, so that's why you receive no virtual difference between a request with and without it.

@jhgg jhgg closed this as completed Aug 13, 2019
@vladfrangu
Copy link
Contributor Author

vladfrangu commented Aug 14, 2019

But shouldn't wait return the message object if true? It's inconsistent with the normal execute webhook endpoint

@Zoddo
Copy link
Contributor

Zoddo commented Aug 14, 2019

This endpoint is emulating slack. So it should return what a true slack webhook would return to be compatible with existing implementations. If it returns a Discord message object, some implementations may think the webhook failed (unexpected data)…

Anyway, this is consistent with the documentation. It doesn't say that slack/github endpoints should return the message object. Only the "normal" endpoint will return the object.

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