Toggle navigation
Toggle navigation
This project
Loading...
Sign in
박시진
/
mamuri-bot
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-05-29 01:33:38 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2f1439975a8daca60b640ae9d429bbb70516a17a
2f143997
1 parent
e1161330
EDIT: Include keyword info in flex message
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
server/chatbot/message/setCarouselMessage.js
server/chatbot/message/setCarouselMessage.js
View file @
2f14399
...
...
@@ -71,11 +71,12 @@ function setCarouselMessage(mamuls) {
pos
=
foundPos
+
1
;
}
console
.
log
(
`pos:
${
pos
}
`
);
if
(
foundPos
!==
1
)
{
if
(
foundPos
!==
-
1
)
{
mamuls
[
i
][
"extraInfo"
]
=
mamuls
[
i
][
"extraInfo"
].
slice
(
0
,
foundPos
)
+
"\n..."
;
console
.
log
(
`parsed extraInfo : \n
${
mamuls
[
i
][
"extraInfo"
]}
`
);
}
else
if
(
mamuls
[
i
][
"extraInfo"
].
length
>
40
)
{
}
if
(
mamuls
[
i
][
"extraInfo"
].
length
>
40
)
{
mamuls
[
i
][
"extraInfo"
]
=
mamuls
[
i
][
"extraInfo"
].
slice
(
0
,
40
)
+
"\n..."
;
console
.
log
(
`parsed extraInfo : \n
${
mamuls
[
i
][
"extraInfo"
]}
`
);
...
...
@@ -101,6 +102,22 @@ function setCarouselMessage(mamuls) {
mamuls
[
i
][
"itemUrl"
],
mamuls
[
i
][
"extraInfo"
]
);
if
(
i
==
0
)
{
flexMessage
[
"header"
]
=
{
type
:
"box"
,
layout
:
"horizontal"
,
contents
:
[
{
type
:
"text"
,
text
:
"매무리 봇"
,
size
:
"sm"
,
color
:
"#1DB446"
},
{
type
:
"text"
,
text
:
`키워드: rtx3080`
,
align
:
"end"
,
color
:
"#1DB446"
,
weight
:
"bold"
,
},
],
};
}
flexMessages
.
push
(
flexMessage
);
}
catch
(
err
)
{
console
.
log
(
err
);
...
...
Please
register
or
login
to post a comment