Open sl-service-account opened 3 years ago
Kadah Coba commented at 2022-02-21T10:18:00Z
I did not know Discord webhooks had this functionality (though it may have been added since I last read that documentation). Would be nice to have. Currently have to deploy a full Discord bot on an external service to achieve similar basic functionality.
Not sure how viable DELETE and reposting would be as a workaround in all cases since the message would be new and not an edit (ie. contribing to the spam aspect).
For reference, I think PATCH is from RFC5789.
How would you like the feature to work?
llHTTPRequest(url, [ HTTP_METHOD, "PATCH", HTTP_MIMETYPE, "application/json", HTTP_VERIFY_CERT, TRUE, HTTP_VERBOSE_THROTTLE, TRUE, HTTP_PRAGMA_NO_CACHE, TRUE ], llList2Json(JSON_OBJECT, json));
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH
Why is this feature important to you? How would it benefit the community?
When creating a webhook for a channel in a Discord server you can send messages from SL via a POST, e.g.:
https://github.com/TBGRenfold/discord-lsl/blob/master/discord_example.lsl
However, in order to edit a previously already sent message via the message token (provided as 'id' in the json http response from the last POST) you must send a http request with method 'PATCH', e.g.:
https://discord.com/developers/docs/resources/webhook#edit-webhook-message
This is an important method needed to cut down on discord channel spam, because status messages could be updated in place instead of creating brand new messages in the discord channel.
Original Jira Fields
| Field | Value | | ------------- | ------------- | | Issue | BUG-229972 | | Summary | Support Method "PATCH" for llHttpRequest | | Type | New Feature Request | | Priority | Unset | | Status | Accepted | | Resolution | Accepted | | Created at | 2021-01-03T18:23:41Z | | Updated at | 2022-02-21T10:20:26Z | ``` { 'Build Id': 'unset', 'Business Unit': ['Platform'], 'Date of First Response': '2022-02-21T04:17:59.647-0600', 'How would you like the feature to work?': 'llHTTPRequest(url, \r\n [ \r\n HTTP_METHOD, "PATCH", \r\n HTTP_MIMETYPE, "application/json",\r\n HTTP_VERIFY_CERT, TRUE,\r\n HTTP_VERBOSE_THROTTLE, TRUE,\r\n HTTP_PRAGMA_NO_CACHE, TRUE ], llList2Json(JSON_OBJECT, json));\r\n\r\nhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH\r\n', 'Original Reporter': 'Send Starlight (Send.Starlight)', 'ReOpened Count': 0.0, 'Severity': 'Unset', 'Target Viewer Version': 'viewer-development', 'Why is this feature important to you? How would it benefit the community?': "When creating a webhook for a channel in a Discord server you can send messages from SL via a POST, e.g.:\r\n\r\nhttps://github.com/TBGRenfold/discord-lsl/blob/master/discord_example.lsl\r\n\r\nHowever, in order to edit a previously already sent message via the message token (provided as 'id' in the json http response from the last POST) you must send a http request with method 'PATCH', e.g.:\r\n\r\nhttps://discord.com/developers/docs/resources/webhook#edit-webhook-message\r\n\r\nThis is an important method needed to cut down on discord channel spam, because status messages could be updated in place instead of creating brand new messages in the discord channel.", } ```