n0bisuke / node-red-contrib-line-messaging-api

NodeREDやenebularでLINE Messaging APIが利用できます。
https://flows.nodered.org/node/node-red-contrib-line-messaging-api
Apache License 2.0
6 stars 8 forks source link

replpy 意外 FlexMessageが利用できりるようになりませんか? #10

Closed zio3 closed 8 months ago

zio3 commented 1 year ago

Replyでは利用できるのですが、そのほかのノードではFlexMassageが送信できずに400 Batrequestになってしまいます。 ソースコードをのぞいたら、Replyだけが対応されていたようです。 ほかのノードでも利用できるようになりませんでしょうか?

n0bisuke commented 1 year ago

I can use it on Reply, but on the other nodes, FlexMassage can't send it and I get a 400 Batrequest. I looked through the source code and it seems that only Reply is supported. Is there any way to make it available for other nodes?

@zio3 Thank you. I will consider it.

n0bisuke commented 8 months ago

v0.2.1でPush_Newというノードを追加しました。Functionノードを間に挟んでFlexMessageを送ることができるようになりました。

スクリーンショット 2024-01-19 3 54 35
msg.payload = {
    "type": "flex",
    "altText": "this is a flex message",
    "contents": {
        "type": "bubble",
        "header": {
            "type": "box",
            "layout": "vertical",
            "contents": [
                {
                    "type": "text",
                    "text": "どっちが好きですか?"
                }
            ]
        },
        "body": {
            "type": "box",
            "layout": "vertical",
            "contents": [
                {
                    "type": "button",
                    "action": {
                        "type": "postback",
                        "label": "Node-RED",
                        "data": "hogehoge",
                        "displayText": "のーどれっど"
                    },
                    "color": "#00cc33",
                    "gravity": "top"
                },
                {
                    "type": "button",
                    "action": {
                        "type": "postback",
                        "label": "Node.js",
                        "data": "hugahuga",
                        "displayText": "コード書きたい"
                    }
                }
            ]
        }
    }
}

return msg;