Toggle navigation
Toggle navigation
This project
Loading...
Sign in
박찬수
/
enjoy_soccer
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
박찬수
2022-06-09 12:26:17 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b780e9eccf27e71934e0bdb73af84070b4f0a7e5
b780e9ec
1 parent
98ceb529
Push 한 사용자에게만 가도록 수정
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
28 deletions
push.js
reply.js
push.js
View file @
b780e9e
...
...
@@ -7,30 +7,36 @@ const TOKEN = 'XOyIf8jsoQKq3b1zqxE4wawAoFU2Hz433AO3w8/ye+i6+2KrXpyfFwY0Dk/xhHQLP
const
USER_ID
=
'Uc4258407a7677769f74ba184ec036651'
//Single User
// request.post(
// {
// url: TARGET_URL,
// headers: {
// 'Authorization': `Bearer ${TOKEN}`
// },
// json: {
// "to": `${USER_ID}`,
// "messages":[
// {
// "type":"text",
// "text":"Hello, user"
// },
// {
// "type":"text",
// "text":"May I help you?"
// }
// ]
// }
// },(error, response, body) => {
// console.log(body)
// });
function
SingleCast
(
sendMsg
,
destination
){
USER_ID
=
destination
;
request
.
post
(
{
url
:
TARGET_URL
,
headers
:
{
'Authorization'
:
`Bearer
${
TOKEN
}
`
},
json
:
{
"to"
:
`
${
USER_ID
}
`
,
"messages"
:[
{
"type"
:
"text"
,
"text"
:
sendMsg
},
{
"type"
:
"text"
,
"text"
:
"May I help you?"
}
]
}
},(
error
,
response
,
body
)
=>
{
console
.
log
(
body
)
});
}
// Multicast User
function
Multicast
(
sendMsg
){
...
...
@@ -78,6 +84,6 @@ function Broadcast(msg){
});
}
exports
.
SendMessage
=
function
(
sendMessage
){
Broadcast
(
sendMessage
);
exports
.
SendMessage
=
function
(
sendMessage
,
destination
){
SingleCast
(
sendMessage
,
destination
);
}
\ No newline at end of file
...
...
reply.js
View file @
b780e9e
...
...
@@ -24,7 +24,7 @@ var step = 0;
var
currentLeagueID
=
0
;
var
currentTeamID
=
0
;
push
.
SendMessage
(
DefaultSelectMessage
());
//
push.SendMessage(DefaultSelectMessage());
data
.
SetData
();
...
...
@@ -211,7 +211,7 @@ function SelectLeagueInfo(eventObj, inputNum){
});
break
;
case
4
:
// 처음으로
SetDefault
();
SetDefault
(
eventObj
.
source
.
userId
);
break
;
default
:
break
;
...
...
@@ -219,9 +219,9 @@ function SelectLeagueInfo(eventObj, inputNum){
return
returnMsg
;
}
function
SetDefault
(){
function
SetDefault
(
userID
){
step
=
0
;
push
.
SendMessage
(
DefaultSelectMessage
());
push
.
SendMessage
(
DefaultSelectMessage
()
,
userID
);
}
function
MakeReplyMessage
(
title
,
keys
,
values
){
...
...
Please
register
or
login
to post a comment