Create webhooks to send messages on Delta Chat.
go install github.com/jgimenez/deltachat-webhook-bot@latestThis program depends on a standalone Delta Chat RPC server deltachat-rpc-server program that must be available in your PATH. For installation instructions check: https://github.com/deltachat/deltachat-core-rust/tree/master/deltachat-rpc-server
- Use your favorite Delta Chat client to create an account for your bot
- Export a backup of your profile: Settings > Chats and media > Export Backup. This will result in a tar file.
- Set
DELTA_CHAT_BOT_IMPORT_ACCOUNTvariable to point to the exported profile (tar file) - Run
deltachat-webhook-bot. It will listen on port 8080 by default.
- Use your Delta Chat client to connect to any users you want to send messages with (for example,
youracct@nine.testrun.org) - Send them a message like this:
curl -d '{"text":"hello world!"}' localhost:8080/youracct@nine.testrun.org
DELTA_CHAT_BOT_IMPORT_ACCOUNT: account backup file to import. Only one account can be imported. Once an account is imported, this variable is ignored.DELTA_CHAT_BOT_LISTEN_ADDR: listen address (default::8080)
Configuration variables may be provided in the environment or in an .env file.
POST /{destination}: send a message todestinationemail address- The
destinationmust be on your bot's contact list - The request should contain a
Content-Type: application/json; charset=utf-8header - The request body should contain a JSON document with:
text: the text of the message to send
- Expect a
204 No contentresponse
- The
Notes:
- The
Content-Typeheader is currently not required, but it is recommended for forward compatibility. - The body of the JSON message is similar to Slack's, on purpose. You may use this endpoint where a Slack webhook endpoint is accepted.
- At the moment it's only possible to send text. PRs are welcome :)