File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 77- Line Messaging API Channel
88- Edit and mv ` .env.example ` to ` .env `
99- RUN ` npm install ` and ` npm run start `
10+
11+
12+ ### how to get your ` LINE_GROUP_ID ` in .env file?
13+
14+ run this project and send ` /give_me_id ` to your bot.
Original file line number Diff line number Diff line change @@ -20,6 +20,19 @@ bot.on('message', async function (event) {
2020 console . log ( 'profile' , await event . source . profile ( ) )
2121 console . log ( 'replyMsg' , replyMsg )
2222
23+ if ( msg === '/give_me_id' ) {
24+ let groupId = event . source . groupId
25+ let userId = event . source . userId
26+ let replyMsg = `* groupId: ${ groupId } \n* userId: ${ userId } `
27+ event . reply ( replyMsg ) . then ( function ( data ) {
28+ console . log ( replyMsg )
29+ } ) . catch ( function ( error ) {
30+ if ( error ) {
31+ console . log ( 'error' )
32+ }
33+ } )
34+ }
35+
2336 // 先拔掉這個功能避免在群組太吵
2437 // event.reply(replyMsg).then(function (data) {
2538 // console.log(replyMsg)
You can’t perform that action at this time.
0 commit comments