Err chatbot plugin to send messages to chats through webhooks
To use this plugin you'll need to configure and activate Webserver plugin first:
!plugin config Webserver {'HOST': '0.0.0.0', 'PORT': 3141 }
This will configure Errbot to listen to requests on all interfaces on port 3141
.
Install the plugin:
!repos install https://github.com/br0ziliy/err-webhook-send.git
Plugin exposes /send_message
endpoint, which expects POST request with
Content-Type: application/x-www-form-urlencoded
header set, and payload
form
field, which contains following JSON: {'to': 'username', 'text': 'message to send' }
.
to
should contain a text representation of message recipient (this value will
be used with build_identifier() call).
Plugin does not check if a user or channel exist upon sending a message, it's up
to you to supply a valid channel/username.
For information about valid identifiers for various backends see Identifiers section below.
text
should contain the message you'd like to send. Markdown formatting is
supported.
Example usage:
curl -m 5 --data-urlencode payload='{"to": "vk", "text": "Hi there\!"}' http://${ERRBOT_IP}:3141/send_message
Above command will send Hi there!
to user vk
.
Currently, plugin adds following commands:
mute [TIMEOUT] [RECEIPIENT]
- mute messages delivery sent to aRECIPIENT
via a webhook forTIMEOUT
number of minutes (15 minutes, ifTIMEOUT
is omitted).RECIPIENT
defaults to a current user, and can represent and valid IRC identifier (see #identifiers below).
List of valid identifiers for various backends:
#channel
user
<#C12345>
<@U12345>
<@U12345|user>
@user
#channel/user
#channel
Any positive integer. Telegram usernames not supported.
Any XEP-0030-compatible JID string.
Usually it's as simple as user@my.jabber.host.com
or
chatroom@my.jabber.host.com
- HipChat
Same as XMPP
- Campfire [UNTESTED]
User name as seen in the Campfire chat room.
- Skype [UNTESTED]
A Skype ID.
- Tox [UNTESTED]
A Tox hash.