Toggle navigation
Toggle navigation
This project
Loading...
Sign in
송용우
/
oss-Jaksimsamil
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
송용우
2020-06-23 13:48:50 +0900
1
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0c81277c465d9754cfe96f488acdf8db29e5fc79
0c81277c
1 parent
570befb2
Init Slack Webhook
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
jaksimsamil-server/package-lock.json
jaksimsamil-server/package.json
jaksimsamil-page/src/lib/util/sendSlack.js → jaksimsamil-server/src/util/sendSlack.js
jaksimsamil-server/package-lock.json
View file @
0c81277
This diff is collapsed. Click to expand it.
jaksimsamil-server/package.json
View file @
0c81277
...
...
@@ -21,7 +21,9 @@
"koa-router"
:
"^9.0.1"
,
"mongoose"
:
"^5.9.17"
,
"morgan"
:
"^1.10.0"
,
"node-schedule"
:
"^1.3.2"
,
"path"
:
"^0.12.7"
,
"slack-client"
:
"^2.0.6"
,
"slack-node"
:
"^0.1.8"
,
"voca"
:
"^1.4.0"
},
...
...
jaksimsamil-
page/src/lib
/util/sendSlack.js
→
jaksimsamil-
server/src
/util/sendSlack.js
View file @
0c81277
const
Slack
=
require
(
"slack-node"
);
// 슬랙 모듈 사용
const
webhookUri
=
'https://hooks.slack.com/services/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'
;
"https://hooks.slack.com/services/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"
;
// Webhook URL
const
slack
=
new
Slack
();
slack
.
setWebhook
(
webhookUri
);
const
send
=
async
(
message
)
=>
{
slack
.
webhook
(
{
channel
:
'#general'
,
// 전송될 슬랙 채널
username
:
'webhookbot'
,
//슬랙에 표시될 이름
text
:
message
,
},
function
(
err
,
response
)
{
console
.
log
(
response
);
}
,
}
);
};
send
(
'안녕'
);
send
(
"hello"
);
...
...
송용우
@2019102188
2020-06-24 15:54:27 UTC
Mentioned in commit
14b0e21b
Please
register
or
login
to post a comment