maubot-incoming_webhook/README.md

41 lines
1.0 KiB
Markdown

incoming webhook
==============
An incoming webhook maubot based on the maugitea plugin
WARNING: This bot is still under development, so things may change, break, or even work properly.
Install & Run
------------
icoming_webhook: just a regular plugin, zip it and upload it.
Webhooks
------------
url: `https://fancy.domain/_matrix/maubot/plugin/<instance_name>/webhook/r0?room=<room-id>`
Add the secret to base-config.yaml
* webhook-secret: "your secret here"
Bot usage
------------
Add the bot to the room and then when you POST a message to the webhook URL the bot will post the message to the room.
Example:
```
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$web_hook_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array('secret' => $web_hook_secret, 'message' => "Here is a test message ")));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
$result = curl_exec($ch);
curl_close($ch);
?>
```