Advertisement
Guest User

Untitled

a guest
Feb 15th, 2020
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.56 KB | None | 0 0
  1. flex = {
  2.                 "type": "bubble",
  3.                 "body": {
  4.                     "type": "box",
  5.                     "layout": "vertical",
  6.                     "contents": [
  7.                         {
  8.                             "type": "text",
  9.                             "text": "您確定要登出麥當勞嗎,登出後將不會自動抽",
  10.                             "weight": "bold",
  11.                             "style": "normal",
  12.                             "decoration": "none",
  13.                             "wrap": True,
  14.                             "size": "xl"
  15.                         }
  16.                         # , {
  17.                         #     "type": "text",
  18.                         #     "text": "目前不開放登入,登出後即無法再次登入!",
  19.                         #     "color": "#FF0000",
  20.                         #     "size": "sm",
  21.                         #     "wrap": True
  22.                         # }
  23.                     ]
  24.                 },
  25.                 "footer": {
  26.                     "type": "box",
  27.                     "layout": "vertical",
  28.                     "spacing": "md",
  29.                     "contents": [
  30.                     ],
  31.                     "flex": 0
  32.                 }
  33.             }
  34.             for index, token in enumerate(token_list):
  35.                 mcd_name = mcd_name_list[index]
  36.                 flex['footer']['contents'].append(
  37.                     {
  38.                         "type": "button",
  39.                         "style": "primary",
  40.                         "color": "#fac209",
  41.                         "height": "sm",
  42.                         "action": {
  43.                             "type": "message",
  44.                             "label": f"登出 {mcd_name}",
  45.                             "text": f"/logout {token}"
  46.                         }
  47.                     }
  48.                 )
  49.             flex['footer']['contents'].append(
  50.                 {
  51.                     "type": "button",
  52.                     "style": "secondary",
  53.                     "height": "sm",
  54.                     "action": {
  55.                         "type": "message",
  56.                         "label": "取消",
  57.                         "text": "取消"
  58.                     }
  59.                 }
  60.             )
  61.             # message=TextSendMessage(
  62.             #     text='您確定要登出麥當勞嗎,登出後將不會自動抽', quick_reply=quick_reply2)
  63.             line_bot_api.reply_message(event.reply_token, FlexSendMessage(
  64.                 alt_text='登出麥當勞', contents=flex, quick_reply=quick_reply))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement