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:54:54 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
10a8573471f3f235fc3b63e7114f5d292d7ce319
10a85734
1 parent
b6eb6e4e
reply, jsonparsing
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
jsonparsing.js
reply.js
jsonparsing.js
View file @
10a8573
...
...
@@ -4,4 +4,13 @@ sampleJson = JSON.parse(sampleJson);
console
.
log
(
sampleJson
);
console
.
log
(
sampleJson
.
response
[
0
].
player
.
name
);
\ No newline at end of file
let
playerName
=
sampleJson
.
response
[
0
].
player
.
name
.
toString
()
console
.
log
(
playerName
);
console
.
log
(
typeof
(
playerName
));
console
.
log
(
JSON
.
stringify
(
sampleJson
.
response
[
0
].
player
.
name
));
console
.
log
(
typeof
(
JSON
.
stringify
(
playerName
)));
stringJson
=
sampleJson
.
toString
();
console
.
log
(
sampleJson
.
toString
());
console
.
log
(
typeof
(
stringJson
));
\ No newline at end of file
...
...
reply.js
View file @
10a8573
...
...
@@ -79,6 +79,9 @@ function Reply(eventObj,replyMsg){
let
replyMsgJSON
=
JSON
.
parse
(
replyMsg
);
let
playerMsg
=
JSON
.
parse
(
replyMsgJSON
.
response
[
0
].
player
.
name
);
let
jsonMsg
=
JSON
.
parse
(
replyMsgJSON
);
request
.
post
(
{
url
:
TARGET_URL
,
...
...
@@ -90,11 +93,11 @@ function Reply(eventObj,replyMsg){
"messages"
:[
{
"type"
:
"Name"
,
"text"
:
replyMsgJSON
.
response
[
0
].
player
.
name
.
toString
()
"text"
:
playerMsg
},
{
"type"
:
"JSON"
,
"text"
:
replyMsgJSON
.
toString
()
"text"
:
jsonMsg
}
]
}
...
...
Please
register
or
login
to post a comment