Skip to content

Instantly share code, notes, and snippets.

@taichunmin
Created June 13, 2020 20:19
Show Gist options
  • Save taichunmin/725af44befc5366962d83d380a74f564 to your computer and use it in GitHub Desktop.
Save taichunmin/725af44befc5366962d83d380a74f564 to your computer and use it in GitHub Desktop.
能使用變數的 LINE 訊息推送小工具
{
"type": "bubble",
"hero": {
"type": "image",
"url": "https://scdn.line-apps.com/n/channel_devcenter/img/fx/01_1_cafe.png",
"size": "full",
"aspectRatio": "20:13",
"aspectMode": "cover"
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "text",
"text": "${nick_name}的擲骰結果",
"weight": "bold",
"size": "xl"
},
{
"type": "box",
"layout": "horizontal",
"contents": [
{
"type": "text",
"text": "四面骰",
"flex": 0
},
{
"type": "text",
"text": "${_.random(1,4)}",
"align": "end"
}
]
},
{
"type": "box",
"layout": "horizontal",
"contents": [
{
"type": "text",
"text": "六面骰",
"flex": 0
},
{
"type": "text",
"text": "${_.random(1,6)}",
"align": "end"
}
]
},
{
"type": "box",
"layout": "horizontal",
"contents": [
{
"type": "text",
"text": "八面骰",
"flex": 0
},
{
"type": "text",
"text": "${_.random(1,8)}",
"align": "end"
}
]
},
{
"type": "box",
"layout": "horizontal",
"contents": [
{
"type": "text",
"text": "十面骰",
"flex": 0
},
{
"type": "text",
"text": "${_.random(1,10)}",
"align": "end"
}
]
},
{
"type": "box",
"layout": "horizontal",
"contents": [
{
"type": "text",
"text": "十二面骰",
"flex": 0
},
{
"type": "text",
"text": "${_.random(1,12)}",
"align": "end"
}
]
}
],
"spacing": "md"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment