Skip to content

Commit

Permalink
feat: 슬랙 메세지 전송시 로그 기록 남기기
Browse files Browse the repository at this point in the history
  • Loading branch information
not-using committed Nov 7, 2023
1 parent d3a7e3c commit 5f73cb5
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/utils/slackChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@ const token = process.env.SLACK_TOKEN;
const web = new WebClient(token);

export const sendText = async (to, text) => {
await web.chat.postMessage({
token,
channel: to,
text,
});
await web.chat
.postMessage({
token,
channel: to,
text,
})
.then(() => console.log(to, text, '메세지를 보냈습니다. '));
};

export const sendBlocks = async (to, blocks) => {
await web.chat.postMessage({
token,
channel: to,
blocks,
});
await web.chat
.postMessage({
token,
channel: to,
blocks,
})
.then(() =>
console.log(to, JSON.stringify(blocks), ' 메세지를 보냈습니다. ')
);
};

0 comments on commit 5f73cb5

Please sign in to comment.