btcpayserver / btcpayserverslackbot

1 stars 2 forks source link

Updates forwarder #1

Open Kukks opened 5 years ago

Kukks commented 5 years ago

We need to make the bot able to accept a message so that it can post updates to the #updates channel and to the IFTT platform.

Message format in json for easy parsing:

sendupdate:
{
  pin: 1234,
  event: "btcpayserver-critical-update",
  title: "BtcPayServer Critical Update",
  message: "New version of btcpayserver released",
}

Bot should post in #updates for us with formatted message from above.

Bot should also be able to listen to the following message:

subscribeupdates:
{
  event: "btcpayserver-critical-update",
  webhookUrl: "https://maker.ifttt.com/trigger/{event}/with/key/xxxx?value1={title}&value2={message}"
}

where event can be * to not filter events and url {} sections get replaced by actual value(url encoded)

You can guess what that does otherwise :P It should also return to the user an id that the user can just send back to bot:

unsubscribeupdates:123

to cancel the subscription

With this in place, users can subscribe to whatever they want using the webhook, and at btcpayserver, we can use the webhook with IFTT to forward the update to Twitter, Mastodon and Mailgun to send an email to a mailing list

Kukks commented 5 years ago
Kukks commented 5 years ago

Simplest flow • user joins slack • Automatically added to #updates • User will receive updates there by default

Btcpay Host flow • User sets up btcpay • User goes to Server Settings • User enters email and subscribes to mailing list • User will receive updates by emails through mailing list

Advanced Flow • User joins slack • User wants to hook some internal systems so that his btcpayserver is automatically updated on critical updates • User messages @Roger Ver: updatesubscribe:{ "event": "btcpayserver-update-critical", "WebhookUrl" :"http://mycompany.com/internal/run-btcpayupdate" } (edited) Those are the user flows Posting an update Workflow:

send sendupdate:{"Pin":"your pin code", "Event": "TestEvent", "Title": "Testing An Automated Update Flow", "Message": "This message was sent as part of an automated streamlined process to notify anyone of updates as needed\nnew line started here"} to @Roger Ver