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-07 19:21:22 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
916ab45dfbb2d8707f29f2c80d646a40174499a1
916ab45d
1 parent
a8fe799c
reply.js modified.
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
29 deletions
reply.js
reply.js
View file @
916ab45
...
...
@@ -75,7 +75,7 @@ try {
console
.
log
(
error
);
}
function
Reply
(
eventObj
){
function
Reply
(
eventObj
,
replyMsg
){
request
.
post
(
{
url
:
TARGET_URL
,
...
...
@@ -91,7 +91,7 @@ function Reply(eventObj){
},
{
"type"
:
"text"
,
"text"
:
"May I help you?"
"text"
:
replyMsg
}
]
}
...
...
@@ -115,31 +115,6 @@ function GetPlayerInfo(playerID, season, eventObj){
request
(
options
,
function
(
error
,
response
)
{
if
(
error
)
throw
new
Error
(
error
);
console
.
log
(
response
.
body
);
Reply
(
eventObj
);
Reply
(
eventObj
,
response
.
body
);
});
}
function
Emitter
(){
this
.
events
=
{};
}
Emitter
.
prototype
.
on
=
function
(
type
,
listener
){
this
.
events
[
type
]
=
this
.
events
[
type
]
||
[];
this
.
events
[
type
].
push
(
listener
);
}
const
emitter
=
new
Emitter
();
emitter
.
on
(
'soccer'
,
function
(){
console
.
log
(
'soccer logged.'
);
})
Emitter
.
prototype
.
emit
=
function
(
type
){
if
(
this
.
events
[
type
]){
this
.
events
[
type
].
forEach
(
function
(
listener
){
listener
();
});
}
}
emitter
.
emit
(
'soccer'
);
\ No newline at end of file
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment