Gathering detailed insights and metrics for botbuilder-linebot-connector
Gathering detailed insights and metrics for botbuilder-linebot-connector
Gathering detailed insights and metrics for botbuilder-linebot-connector
Gathering detailed insights and metrics for botbuilder-linebot-connector
npm install botbuilder-linebot-connector
Typescript
Module System
Node Version
NPM Version
TypeScript (77.93%)
JavaScript (21.71%)
Shell (0.36%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
88 Stars
142 Commits
16 Forks
5 Watchers
3 Branches
4 Contributors
Updated on Jun 14, 2024
Latest Version
2.5.0
Package Id
botbuilder-linebot-connector@2.5.0
Unpacked Size
179.88 kB
Size
39.50 kB
File Count
20
NPM Version
6.4.1
Node Version
10.15.3
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
1
Microsoft Bot Framework V3 connector for Line office account
LINE Messaging API for Node.js
Please refer to the official API documents for details.
1npm install --save botbuilder-linebot-connector
If you want to thank me, or promote your Issue.
Sorry, but I have work and support for packages requires some time after work. I will be glad of your support and PR's.
1var builder = require("botbuilder") 2var LineConnector = require("botbuilder-linebot-connector"); 3 4var express = require('express'); 5var server = express(); 6 7server.listen(process.env.port || process.env.PORT || 3980, function () { 8 console.log("listening to"); 9}); 10 11 12var connector = new LineConnector.LineConnector({ 13 hasPushApi: false, //you have to pay for push api >.,< 14 autoGetUserProfile:true, //default is false 15 // your line 16 channelId: process.env.channelId || "", 17 channelSecret: process.env.channelSecret || "", 18 channelAccessToken: process.env.channelAccessToken || "" 19}); 20 21server.post('/line', connector.listen()); 22 23var bot = new builder.UniversalBot(connector) 24 25var push = new builder.Message() 26 .address(<any>a) 27 .addAttachment(new ImageMap(<any>a, 28 "test", 29 "https://www.profolio.com/sites/default/files/styles/1920x1040/public/field/image/Bikini_Girls_adx.jpg?itok=uciEvomy", 30 { 31 "width": 1040, 32 "height": 1040 33 }, 34 [] 35 )) 36bot.send(push); 37 38bot.dialog("/", s => { 39 try{ 40 let u = await connector.getUserProfile(s.message.from.id) 41 console.log("u" + u) 42 if (u === undefined) { 43 s.send("who said:" + s.message.text) 44 } else { 45 s.send("hello " + u.displayName) 46 } 47 }catch(e){ 48 s.send("can`t get user profile!") 49 } 50 //image map 51 52 s.send(new builder.Message(s).addAttachment(new ImageMap(s, 53 "test", 54 "https://www.profolio.com/sites/default/files/styles/1920x1040/public/field/image/Bikini_Girls_adx.jpg?itok=uciEvomy", 55 { 56 "width": 1040, 57 "height": 1040 58 }, 59 [ 60 { 61 "type": "uri", 62 "linkUri": "https://google.com/", 63 "area": { 64 "x": 0, 65 "y": 0, 66 "width": 333, 67 "height": 1040 68 } 69 }, 70 { 71 "type": "message", 72 "label": "good", 73 "text": "hot", 74 "area": { 75 "x": 333, 76 "y": 0, 77 "width": 333, 78 "height": 1040 79 } 80 }, 81 ] 82 83 84 ))); 85 86 s.send(new builder.Message(s) 87 /* Sticker */ 88 .addAttachment( 89 new LineConnector.Sticker(s, 1, 1) 90 ) 91 /* Location */ 92 .addAttachment( 93 new LineConnector.Location(s, "my test", "中和", 35.65910807942215, 139.70372892916203) 94 ) 95 /* Audio file */ 96 .addAttachment( 97 new builder.AudioCard(s).media([{ 98 url: "https://xxx", //file place must be https 99 profile: "music" 100 }]) 101 /* Image file */ 102 ).addAttachment( 103 new builder.MediaCard(s).image(builder.CardImage.create(s, 'https://imagelab.nownews.com/?w=1080&q=85&src=http://s.nownews.com/5d/6b/5d6b74b674e643f522ed68ef83053a1f.JPG')) 104 /* Video file */ 105 ).addAttachment( 106 new builder.MediaCard(s).media('https://imagelab.nownews.com/?w=1080&q=85&src=http://s.nownews.com/5d/6b/5d6b74b674e643f522ed68ef83053a1f.JPG').image(builder.CardImage.create(s, 'https://imagelab.nownews.com/?w=1080&q=85&src=http://s.nownews.com/5d/6b/5d6b74b674e643f522ed68ef83053a1f.JPG')) 107 ) 108 ); 109 110 111 /* Dialog */ 112 s.send(new builder.Message(s) 113 .addAttachment( 114 new builder.HeroCard(s) 115 116 .title("Classic White T-Shirt") 117 .subtitle("100% Soft and Luxurious Cotton") 118 .text("Price is $25 and carried in sizes (S, M, L, and XL)") 119 .images([builder.CardImage.create(s, 'https://imagelab.nownews.com/?w=1080&q=85&src=http://s.nownews.com/11/b9/11b93df1ec7012f4d772c8bb0ac74e10.png')]) 120 121 .buttons([ 122 //left text message 123 builder.CardAction.imBack(s, "buy classic gray t-shirt", "Buy"), 124 //set timer 125 new builder.CardAction().type("datatimepicker").title("time"), 126 //postback 127 builder.CardAction.postBack(s, "action=buy&itemid=111", "send data"), 128 //open irl 129 builder.CardAction.openUrl(s, "https://1797.tw", "1797") 130 131 ]) 132 ) 133 ) 134 /* Carosuel */ 135 136 var msg = new builder.Message(s); 137 msg.attachmentLayout(builder.AttachmentLayout.carousel) 138 msg.attachments([ 139 140 new builder.HeroCard(s) 141 .title("Classic White T-Shirt") 142 .subtitle("100% Soft and Luxurious Cotton") 143 .text("Price is $25 and carried in sizes (S, M, L, and XL)") 144 .images([builder.CardImage.create(s, 'https://imagelab.nownews.com/?w=1080&q=85&src=http://s.nownews.com/11/b9/11b93df1ec7012f4d772c8bb0ac74e10.png')]) 145 .buttons([ 146 builder.CardAction.openUrl(s, "https://1797.tw", "1797"), 147 new builder.CardAction().type("datatimepicker").title("time"), 148 builder.CardAction.postBack(s, "action=buy&itemid=111", "send data"), 149 ]), 150 new builder.HeroCard(s) 151 .title("Classic Gray T-Shirt") 152 .subtitle("100% Soft and Luxurious Cotton") 153 .text("Price is $25 and carried in sizes (S, M, L, and XL)") 154 .images([builder.CardImage.create(s, 'https://imagelab.nownews.com/?w=1080&q=85&src=http://s.nownews.com/5d/6b/5d6b74b674e643f522ed68ef83053a1f.JPG')]) 155 .buttons([ 156 new builder.CardAction().type("datatimepicker").title("time"), 157 builder.CardAction.imBack(s, "buy classic gray t-shirt", "Buy"), 158 builder.CardAction.postBack(s, "action=buy&itemid=111", "send data"), 159 ]) 160 ]); 161 s.send(msg) 162 163 164}) 165 166 167bot.dialog('leave' 168 , s => { 169 s.send("byebye"); 170 //only work in group or room 171 connector.leave(); 172 173 s.endDialog() 174 175 } 176).triggerAction({ 177 matches: /^leave$/i 178}); 179 180bot.on('conversationUpdate', function (message) { 181 // detect event 182 switch (message.text) { 183 case 'follow': 184 break; 185 case 'unfollow': 186 break; 187 case 'join': 188 break; 189 case 'leave': 190 break; 191 } 192 var isGroup = message.address.conversation.isGroup; 193 var txt = isGroup ? "Hello everyone!" : "Hello " + message.from.name; 194 var reply = new builder.Message() 195 .address(message.address) 196 .text(txt); 197 bot.send(reply); 198 bot.beginDialog(message.address, "hello") 199}); 200 201bot.dialog("hello", [ 202 s => { 203 builder.Prompts.text(s, "go"); 204 }, 205 (s, r) => { 206 s.send("oh!" + r.response) 207 s.endDialog() 208 } 209]) 210
The MIT license
#If you like this, Welcome to give me Star
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/28 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
15 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More