Googleスプレッドシートの特定の名前のLINEアカウントユーザーへflexMessageを送る

Google

1function targetingMessage() { 2 const cells = sheet.createTextFinder('テスト').findAll(); 3 let userIds = []; 4 for (const cell of cells) { 5 userIds.push(cell.offset(0, -1).getValue()); 6 } 7 8 bot.multicastMessage(userIds, [bot.textMessage(`テストだよ`)]); 9//上記までのコードでは`テスト`のユーザーIDの人にLINEできます// 10//それプラスで下記のコードを追記したらエラーになりました// 11 12 const flex_message = { 13 "type": "bubble", 14 "hero": { 15 "type": "image", 16 "url": "https://linecorp.com", 17 "size": "full", 18 "aspectRatio": "20:13", 19 "aspectMode": "cover", 20 "action": { 21 "type": "uri", 22 "uri": "https://linecorp.com" 23 } 24 }, 25 "body": { 26 "type": "box", 27 "layout": "vertical", 28 "spacing": "md", 29 "action": { 30 "type": "uri", 31 "uri": "https://linecorp.com" 32 }, 33 "contents": [ 34 { 35 "type": "text", 36 "text": "空き情報", 37 "size": "xl", 38 "weight": "bold" 39 }, 40 { 41 "type": "box", 42 "layout": "vertical", 43 "spacing": "sm", 44 "contents": [ 45 { 46 "type": "box", 47 "layout": "baseline", 48 "contents": [ 49 { 50 "type": "icon", 51 "url": "*************************" 52 }, 53 { 54 "type": "text", 55 "text": "テストだよ", 56 "weight": "bold", 57 "margin": "xs", 58 "flex": 0, 59 "size": "xxs" 60 } 61 ] 62 } 63 ] 64 }, 65 { 66 "type": "text", 67 "text": "テストだよ:", 68 "wrap": true, 69 "color": "#aaaaaa", 70 "size": "xxs" 71 } 72 ] 73 }, 74 "footer": { 75 "type": "box", 76 "layout": "vertical", 77 "contents": [ 78 { 79 "type": "button", 80 "style": "primary", 81 "margin": "xxl", 82 "action": { 83 "type": "uri", 84 "label": "詳しくはこちら", 85 "uri": "*************" 86 }, 87 "color": "#00008b" 88 } 89 ] 90 } 91} 92bot.replyMessage(e, [bot.flexMessage(flex_message, "テキスト")]); 93}

コメントを投稿

0 コメント