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 05:41:51 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c3d67805f1a993272ecb92916b8790691bce2dc9
c3d67805
1 parent
093a58a2
번호 고르기 기능 추가
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
9 deletions
reply.js
reply.js
View file @
c3d6780
...
...
@@ -15,6 +15,9 @@ var data = require('./getid.js');
const
bodyParser
=
require
(
'body-parser'
);
var
isLeagueInfo
=
false
;
var
step
=
0
;
var
currentLeagueID
=
0
;
var
currentTeamID
=
0
;
...
...
@@ -22,6 +25,7 @@ data.SetData();
var
app
=
express
();
app
.
use
(
bodyParser
.
json
());
app
.
post
(
'/hook'
,
function
(
req
,
res
)
{
var
eventObj
=
req
.
body
.
events
[
0
];
...
...
@@ -102,17 +106,28 @@ function GetPlayerInfo(playerID, season, eventObj){
function
SelectAPI
(
eventObj
,
commingMsg
){
if
(
tryParse
.
int
(
commingMsg
)
!=
null
){
// 리그 선택
SelectLeague
(
tryParse
.
int
(
commingMsg
));
Reply
(
eventObj
,
SelectLeagueInfo
);
if
(
step
==
0
){
isLeagueInfo
=
true
;
SelectLeague
(
tryParse
.
int
(
commingMsg
));
Reply
(
eventObj
,
SelectLeagueInfoMessage
());
}
else
if
(
step
==
1
&&
isLeagueInfo
){
Reply
(
eventObj
,
SelectLeagueInfo
(
tryParse
.
int
(
commingMsg
)));
}
else
if
(
step
==
1
&&
!
isLeagueInfo
){
Reply
(
eventObj
,
SelectTeamInfo
(
tryParse
.
int
(
commingMsg
)));
}
}
else
{
// 팀명 입력
papago
.
TranslateKRtoEN
(
commingMsg
,
function
(
transedMsg
){
//Reply(eventObj, transedMsg);
currentTeamID
=
data
.
SearchTeam
(
transedMsg
);
Reply
(
eventObj
,
SelectTeamInfo
());
if
(
step
==
0
){
currentTeamID
=
data
.
SearchTeam
(
transedMsg
);
Reply
(
eventObj
,
SelectTeamInfoMessage
());
}
});
}
;
step
++
;
}
function
SelectLeague
(
inputNum
){
...
...
@@ -156,12 +171,24 @@ function SelectLeague(inputNum){
return
leagueID
;
}
function
SelectLeagueInfo
(){
let
msg
=
'1. 팀 순위 \n 2. 득점 순위 \n 3. 도움 순위'
;
function
SelectLeagueInfo
(
inputNum
){
return
'You Selected '
+
inputNum
.
toString
();
}
function
SelectTeamInfo
(
inputNum
){
return
'You Selected '
+
inputNum
.
toString
();
}
function
DefaultSelectMessage
(){
return
'환영합니다.'
;
}
function
SelectLeagueInfoMessage
(){
let
msg
=
'1. 팀 순위 \n2. 득점 순위 \n3. 도움 순위 \n4. 처음으로'
;
return
msg
;
}
function
SelectTeamInfo
(){
let
msg
=
'1. 경기 일정 \n
2. 소속 선수 \n 3. 순위
'
;
function
SelectTeamInfo
Message
(){
let
msg
=
'1. 경기 일정 \n
2. 소속 선수 \n3. 순위 \n4. 처음으로
'
;
return
msg
;
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment