-
-
Notifications
You must be signed in to change notification settings - Fork 25
Webhooks #1
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 #1
Conversation
|
could the author ID be the webhook ID? and the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would message author be optional? I would think something along the lines of @itzTheMeow's comment would be better to work with. Leave the author id out and just use the webhook id.
|
Both ways is still a breaking change, I would prefer to properly separate them out, having to check other keys to find out how to parse a different item is not a good way to handle it. |
|
you still have to check that the webhook key exists (or that the author id doesn't). also why not send the webhook name/avatar with the message instead of making the user fetch it separately? or add a way to fetch all hooks for a server |
|
is there going to be a way to reset the webhook token without recreating it? or does that seem unnecessary |
Co-authored-by: Meow <me@itsmeow.cat>
|
As per internal group chat, if the webhook is actually attached to a message, it should use the following struct: struct MessageWebhook {
// Id of Webhook
id: String,
// The name of the webhook - 1 to 32 chars
name: String,
// The id of the avatar of the webhook, if it has one
avatar: Option<String>,
} |
|
One thing I was wondering about. Given the github integration, why not also support other remote git repo hosts like GitLab, BitBucket, Codeberg, etc, if they allow webhook sending? Maybe even have two general paths EDIT: Alternatively could additional routes be provided like this: PATCH /webhooks/<target>/<token>/<message> - Edits a webhook message using a token, no permission required
PATCH /webhooks/<target>/<message> - Edits a webhook message, requires permission
DELETE /webhooks/<target>/<token>/<message> - Deletes a webhook message using a token, no permission required
DELETE /webhooks/<target>/<message> - Deletes a webhook message, requires permissionThis - again - is based on if the current PATCH and DELETE routes don't allow a webhook message id to be provided (Which I feel could be the better aproach). |
|
Also, this is unrelated to this RFC in particular, but to RFC in general: Maybe re-structure the shown API routes a bit by having a code highlighting ( See my previous comment for a working example. |
I mentioned in the future ideas section on expanding the supported platforms, in the future I think it would be good to add more in another RFC, for the core webhooks RFC just GitHub support will be enough. I cant see why a edit message route would be needed for webhooks, as all you should need is just creating messages, if you can think of some good examples on where you would need it then I might consider it. |
|
It might be useful if someone, say, edits an issue/comment? For what it's worth I think Discord lets you edit webhook messages, although if so they don't use this for the GitHub integration so hmm |
For what it's worth this also seems like a good idea to me |
webhooks are stateless in how they are implemented so we have no way of mapping the edit to the correct message, i dont think its worth maintaining a state for this. |
The only case I could give is something similar to Discord's announcement feature, allowing to update a previously crossposted message. |
Bridges as they currently exist don't use webhooks and instead use masquerades, and I don't think there's any benefit to switching to webhooks. "Native bridges" as they would be implemented later, would not have anything to do with webhooks either. |
|
I think this is pretty much ready to merge now? |
|
Webhooks will have some interesting uses for Revolt but definitely could be better than other platforms. Maybe a good idea would be to add a seperate permission set for webhooks so you can restrict masquerade so the webhook can't change name/avatar and only use default one, send embeds, use external emojis from other servers (not sure if it can check) and other stuff in the future. |
|
Most services also have a /slack webhook type that is popular to use by many services, would there be support for this. |
Agree on this. |
|
Webhooks will be available on staging soon for testing, some caveats which need to be addressed:
|
|
it's a bit late for this but can't webhooks be handled by an official appbot? |
|
I don't see the use in merging them together, they are separate ideas. |
|
This RFC is now in its final comment period, if no other discussion is needed, this RFC can be merged. |
|
There is one thing I was wondering about. Does Revolt have a base-level check for malicious URLs using a database when messages are send to prevent such sending. |
Currently no, however if it were to be added it would automatically be available for webhooks since they share the message sending code. |
No description provided.