Using the Webhook - TheBlackParrot/DumbRequestManager GitHub Wiki
By default, the Webhook is disabled. To enable it, set the WebHookUrl
variable to the URL of the Webhook that needs to be interacted with in the mod's configuration file (found at UserData/DumbRequestManager.json
)
The Webhook is only an event trigger, nothing can be inputted.
Note
This is only showing an example of how to handle the pressedPoke
event. For more listenable events, see the Events section.
Note
Your bot should have documentation on how to set up Webhooks if it supports them. Follow their instructions on setting one up, as this page does not go into detail on how to do that. It is assumed you have one set up already.
Select a requested map in the queue, and press the "Poke" button. You should get a JSON-formatted Webhook message back (via HTTP POST) that follows this data structure:
{
"timestamp": 1745374880148,
"id": "33f0216b-bbed-4784-a9fd-aead73fae069",
"event": "pressedPoke",
"data": <map data>
}
We can check which event was triggered by using a conditional on the event
variable within the response object. For the poke button specifically, we want pressedPoke
.
Using the map data in data
, we can send a chat message mentioning the requester that we want their attention for the selected request. Everything we need to do so is in this Data
object.
Note
data
will be formatted the same way map data is used with the HTTP API. See the Map data object structure for what this will look like.
Tip
For events like queueOpen
, the data
object won't contain map data, it will be of another type (in this case, a boolean -- true
or false
).
You can see what happens by opening and closing the queue by pressing the toggle on the left side in-game while viewing the request queue.