broidHQ / integrations

Connect your App to Multiple Messaging Channels with the W3C Open standard.
https://www.broid.ai
GNU Affero General Public License v3.0
745 stars 83 forks source link

Broid-Slack support message formatting #148

Open ShinyChang opened 7 years ago

ShinyChang commented 7 years ago

Overview

Details

Broid-Slack is awesome, but I can not do advance things with broid-slack. For example, I can not send custom attachment with below format:

{
    "text": "I am a test message http://slack.com",
    "attachments": [
        {
            "text": "And here’s an attachment!"
        }
    ]
}

reference: https://api.slack.com/docs/messages/builder

do you have any plan to support message formatting?

killix commented 7 years ago

Did you try something like that:

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Create",
  "generator": {
    "id": "f6e92eb6-f69e-4eae-8158-06613461cf3a",
    "type": "Service",
    "name": "slack"
  },
  "object": {
    "type": "Note",
    "content": "I am a test message http://slack.com",
    "attachment": [{
        "type": "Image",
        "content": "And here’s an attachment description!",
        "name": "And here’s an attachment title!",
        "url": "And here’s an attachment!"
    }]
  },
  "to": {
    "type": "Group",
    "id": "C1L7YRBLG"
  }
}
ShinyChang commented 7 years ago

I tried this and it will works. But it shows error if no attachment type.

I'd like to display some message like below image

It looks like impossible in current version. (if type not in Image/Button/Video)