송용우

Merge commit '4107ab9c' into feature/frontend_page

This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
......@@ -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"
},
......
......@@ -7,6 +7,7 @@ const ProfileSchema = new Schema({
userBJID: String,
solvedBJ: Object,
friendList: [String],
slackWebHookURL: String,
});
ProfileSchema.statics.findByUsername = function (username) {
return this.findOne({ username });
......
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");
......