Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
개발자가 동료의 업무효율을 높이는 방법 | 슬랙봇 개념부터 개발까지
Search
Seungmin 마량
May 07, 2024
Programming
0
120
개발자가 동료의 업무효율을 높이는 방법 | 슬랙봇 개념부터 개발까지
2024년 5월 7일 에어프레미아 내부 기술세션에서 발표한 슬랙봇 발표입니다.
슬랙봇이 무엇인지 기초 개념 설명부터 만드는 방법 코드까지 빠르게 살펴봅니다.
Seungmin 마량
May 07, 2024
Tweet
Share
More Decks by Seungmin 마량
See All by Seungmin 마량
30살에 구글이 인정한 개발자가 될 수 있었던 공부법
maryang
0
60
좋은 서비스를 만들기 위한 제품팀 문화 이해하기
maryang
0
41
사수 없는 주니어 개발자가 성장하는 방법
maryang
0
280
개발자가 성과를 증명하는 방법 | A/B테스트 기반 개발
maryang
0
87
성장하는 스타트업이 사용하는 협업툴과 커뮤니케이션 방법
maryang
0
93
YOLO로 행복한 탑티어 개발자 되기
maryang
0
220
초 레거시 JSP 프로젝트를 최신 Next.js 13으로 마이그레이션 하기
maryang
0
70
Firebase에서 최신 Next.js를 사용하여 웹사이트 운영하기
maryang
0
250
겨울이 왔습니다. 저는 퇴사합니다.
maryang
0
110
Other Decks in Programming
See All in Programming
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
230
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
120
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.1k
cmp.Or に感動した
otakakot
1
120
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
6
1.7k
最新TCAキャッチアップ
0si43
0
140
Better Code Design in PHP
afilina
PRO
0
120
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
Featured
See All Featured
Practical Orchestrator
shlominoach
186
10k
Ruby is Unlike a Banana
tanoku
97
11k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
Mobile First: as difficult as doing things right
swwweet
222
8.9k
For a Future-Friendly Web
brad_frost
175
9.4k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
860
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
RailsConf 2023
tenderlove
29
900
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Making Projects Easy
brettharned
115
5.9k
Transcript
ѐߊоزܐসޖബਯਸ ֫חߑߨ ठۑࠈѐ֛ࠗఠѐߊө
ݾର 1.Slack ࠈ ೧ೞӝ 2.ࠈ ٜ݅ӝ 3.ࢸ ؊ࠁӝ 4.݃ޖܻ
01 Slack ࠈ ೧ೞӝ
߈ࠂੋসਸࢎۈनࣻ೯ೞח ࣗਝয۽Ӓ 램 Bot
Bot - Github Action
Bot - Jira Automation
Bot - Chat Bot
Bot - ݫ۽
4MBDLҗ*OUFSBDUJPOೞחࠈ Slack ࠈ ৻ࠗ߮ܳ4MBDLਵ۽ঌܿ߉ 4MBDLਵ۽৻ࠗبҳীݺ۸ਸࣻ೯
Slack ࠈ द - Polly
Slack ࠈ द - Donut
Slack ࠈ द - Jira
Slack ࠈ द - ߓನ زച
Why Slack Bot? ৵4MBDLҗ*OUFSBDUJPO೧ঠೞ ߹ب۽Ӓ 램 ী 서 بоמೠؘ
4MBDLҗ*OUFSBDUJPOೞחࠈ
ഥࢎী 서 оয় 랜 दрࢎਊೞחో Why Slack Bot ݫन
ഥࢎী 서 оয় 랜 दрࢎਊೞחో Why Slack Bot
সޖ೦࢚ெઉחೞաبҳ۽ ঌܿ߉Ҋܲبҳрױೠ 조 өࣻ೯ Why Slack Bot
সޖܴਸೠҔী 서 ઁয ࢤࢿೱ࢚ Why Slack Bot
02 ࠈ ٜ݅ӝ
Slack ࠈ ҳࢿب 4MBDL "QQ "QQ "QQ 4FSWFS
4MBDL "QQ "QQ "QQ 4FSWFS Slack জ ٜ݅ӝ
Slack জ ٜ݅ӝ BQJTMBDLDPN
Slack জ ٜ݅ӝ
Slack জ ٜ݅ӝ 4MBDL$MPVEীজਸস۽٘
Slack জ ࢸ
Slack জ ࢸ ࠈਬࢸ FY
Slack জ ࢸ
Slack জ ࢸ 4MBDLਕझಕझীজਸࢸ աܳా೧ࢲ 4MBDLҗࣗా೧_ "QQ
Slack ࠈ ࢲߡ ٜ݅ӝ 4MBDL "QQ "QQ "QQ 4FSWFS
8FCIPPL Slack ࠈ ࢲߡ ҳࢿ ߑߨ #PMU 4%,
8FCIPPL Slack ࠈ ࢲߡ ҳࢿ ߑߨ #PMU 4%,
ޖоݫࣁܳࠁղҊरਵݶౠ63-ਸഐ೧ IUUQTIPPLTTMBDLDPNTFSWJDFT 8FCIPPLઁҕ ৻ࠗࢲ࠺झ Slack Webhook
߮ߊࢤ4MBDLীঌܿݫࣁܳࠁղ IUUQTIPPLTTMBDLDPNTFSWJDFTj CPEZ\TPNFEBUB^ ޖоݫࣁܳࠁղҊरਵݶౠ63-ਸഐ೧ IUUQTIPPLTTMBDLDPNTFSWJDFT Slack Webhook
URL ഐ۽ Slackী ݫࣁܳ ࣠ Slack Webhook Webhook
Slack Webhook ٜ݅ӝ 8FCIPPL63-ഝਊ
Slack Webhook ഝਊ ৻ࠗࢲ࠺झী63-١۾ ࠁా*OUFHSBUJPOਸઁҕ 63-ਸഐ PS
Slack Webhook 4MBDLীݫࣁܳࠁղחਊب۽ ѐߊহऔѱҳഅ ഝਊೡࣻ
Slack Webhook ױ Ӓ৻زਸݽفࣻ೯ೡࣻহ 4MBDLীݫࣁܳࠁղחਊب۽ ѐߊহऔѱҳഅ ഝਊೡࣻ
٣పੌೠزਸҳഅೞ۰ݶ ࢲߡѐߊਃೞ
8FCIPPL Slack ࠈ ࢲߡ ҳࢿ ߑߨ #PMU 4%,
Boltۆ? #PMUJTBGSBNFXPSL UIBUTJNQMJGJFTUIFQSPDFTTPGDSFBUJOH4MBDLBQQT
Boltۆ? ठۑࣗాী୭ചػࢲߡۨਕ MJLF4QSJOH
ਗ য
ࢲߡ द জোѾ ࢲߡद
Slack Event ߉ӝ ܻ߮झց١۾
Slack Event ࠁղӝ ݫࣁ࣠
ۨಌ۠झ TMBDLEFWCPMUKT
8FCIPPL Slack ࠈ ࢲߡ ҳࢿ ߑߨ #PMU 4%,
SDKۆ? ठۑࣗాӝמਸыಁఃژחۄ࠳۞ܻ 📚
ਗ য
Slack Node SDK
Slack Node SDK
ۨಌ۠झ BQJTMBDLDPN
ۨಌ۠झ
SDK ࢲߡҳࢿ 4%,ח4MBDLҗࣗాೞחࣁࠗӝמݽ ۄ࠳۞ܻ 4MBDL&WFOUܳ߉Ҋࠁղחࢲߡӝמহ بҳחחؘࢎਊೡࢎۈহ
SDK ࢲߡҳࢿ ӝઓۨਕ۽ࢲߡܳҳࢿೞҊ 4%,ܳઓࢿਵ۽оઉ৬ࢲഝਊ झ݂ Ҋ ۄझ ֢٘ ֎झ ֏झ
Ҋ ܖ࠺ৡۨੌૉjݽفоמ
ח… 5ZQFTDSJQUॳҊरযਃ
Slack Client ҳࢿ import { WebClient } from "@slack/web-api"; this.slackClient
= new WebClient(process.env.SLACK_BOT_TOKEN); const app = await NestFactory.create(AppModule); await app.listen(3000); জোѾ
Nest ࢲߡ द import { WebClient } from "@slack/web-api"; this.slackClient
= new WebClient(process.env.SLACK_BOT_TOKEN); const app = await NestFactory.create(AppModule); await app.listen(3000); ࢲߡद
Slack Event ߉ӝ @Get("/") getHello(): string { return this.slackService.getHello(); }
/FTUী 서 $POUSPMMFSࢸ 4MBDLী 서 63-ഐ 4%,ӝמইפ
async postMessage(channelName: string, message: string) { const channelId = await
this.getChannelIdByName(channelName); if (channelId) { this.slackClient.chat.postMessage({ channel: channelId, text: message, }); } } Slack Event ࠁղӝ ݫद࣠
Bolt vs SDK 4MBDL୭ച೧֬ࢲߡۨਕ WT ղо 선 ఖ ࢸоמೠࢲߡۨਕ #PMU
4%, ҳഅಞೞ ਬبо֫
ח… 4MBDL୭ച೧֬ࢲߡۨਕ WT ղо 선 ఖ ࢸоמೠࢲߡۨਕ #PMU 4%, ҳഅಞೞ
ਬبо֫
৻ࠗ ࢲ࠺झ োز 4MBDL "QQ "QQ "QQ 4FSWFS
Slack Event ߉ӝ @Get("/") getHello(): string { return this.slackService.getHello(); }
/FTUী 서 $POUSPMMFSࢸ 4MBDLী 서 63-ഐ
৻ࠗ ࢲ࠺झ Event ߉ӝ @Get("/") getHello(): string { return this.slackService.getHello();
} /FTUী 서 $POUSPMMFSࢸ 4MBDLী 서 63-ഐ ৻ࠗ 서 ࠺झ
Slack ࠈ ҳࢿب 4MBDL "QQ "QQ "QQ 4FSWFS
03 ࢸ ؊ࠁӝ
async postMessage(channelName: string, message: string) { const channelId = await
this.getChannelIdByName(channelName); if (channelId) { this.slackClient.chat.postMessage({ channel: channelId, text: message, }); } } Slack Event ࠁղӝ ݫद࣠
ӂೠ async postMessage(channelName: string, message: string) { const channelId =
await this.getChannelIdByName(channelName); if (channelId) { this.slackClient.chat.postMessage({ channel: channelId, text: message, }); } } زೞঋח షীӂೠহ
ӂೠ ޙࢲী 서 ӂೠഛੋ ࣛী 서 ࠈషӂೠ୶о
Slack Event ߉ӝ @Get("/") getHello(): string { return this.slackService.getHello(); }
/FTUী 서 $POUSPMMFSࢸ 4MBDLী 서 63-ഐ
@Get("/") getHello(): string { return this.slackService.getHello(); } /FTUী 서 $POUSPMMFSࢸ
4MBDLী 서 63-ഐ Event Subscriptions
Event Subscriptions ࣛী 서 ߮ҳة୶о
߮ߊࢤदഐೡ63-ࢸ Event Subscriptions ࠈࢲߡبݫੋ
Socket Mode 4MBDLܻࢲߡܳഐೡࣻহݶ 🤯 ߑച߷١ࠁউਬ
Socket Mode জҗࢲߡܳো 결 ೞח 4PDLFU.PEF 🤝
Socket Mode জۨ߰షࢤࢿ
this.slackSocketClient = new SocketModeClient({ appToken: process.env.SLACK_APP_TOKEN, }); SocketClient ࢤࢿ 8FC$MJFOU৬ܲ
4PDLFU$MJFOUࢤࢿ
this.slackSocketClient = new SocketModeClient({ appToken: process.env.SLACK_APP_TOKEN, }); ࠈషইצ জషোѾ SocketClient
ࢤࢿ
this.slackSocketClient.on("app_mention", (event) => { event.ack(); const text = event.event.text as
string; }); Socket Mode Event ߉ӝ ܻ߮झց١۾
this.slackSocketClient.on("app_mention", (event) => { event.ack(); const text = event.event.text as
string; }); Socket Mode Event ܴ߮ഛੋਃ
Event ۨಌ۠झ BQJTMBDLDPN
04 ݃ޖܻ
4MBDLࠈਵ۽ޖਸೡࣻաਃ
ੋࢎ%# ോоੋਗঌ۰ 📑 🤗 झாે۞ ࠈ ഝਊ द 1
"QQ ݒੌইஜदോоੋਗঌܿ ठۑࠈࢲߡ ࠈ ഝਊ द 1
ࠈ ഝਊ द 2 "QQ ठۑࠈࢲߡ ࠂ౭ॳҊर🥰 /35ডਯঌ۰ ড%# 📑
/35ডਯঌ۰
"QQ ठۑࠈࢲߡ 📑 /35ઝࢳթওणפ /35ઝࢳթওणפ 🤓 ড%# ࠈ ഝਊ द
2
"QQ ठۑࠈࢲߡ 📑 /35ઝࢳթওणפ /35ઝࢳթওणפ %#ઑഥহ־ҳաऔѱডਯഛੋ 🤓 ড%# ࠈ ഝਊ
द 2
೦ҕझாે ղੌझாે 📑 😏 झாે۞ ࠈ ഝਊ द 3
ࠈ ഝਊ द 3 "QQ 4'0࠺೯ 널 ࢤࢿ " #
$ઑઙࢎ৬% & 'थޖਗୡ ठۑࠈࢲߡ
🛫 🛬 BCDEFGHŦũŬŮŶŷź_! ࠈ ഝਊ द 3
ࠈ ഝਊ द 3 "QQ ࠺೯ੌٍ4'0࠺೯ 널 ই࠳ ࠺೯ಣо݂࣠ ठۑࠈࢲߡ
"QQ ࠺೯ੌٍ4'0࠺೯ 널 ࠺೯ಣо݂࣠ ठۑࠈࢲߡ ࠺೯ழޭפா࣌ҙܻزച 😎 ࠈ ഝਊ द
3
ࠈ ೱ۱ 4MBDL*5 ೦ݽفഝਊೞח ীযۨইਃழޭפா࣌ో 4MBDLࠈࢎࢤࢿਸೱ࢚दఈפ
ޖटࠈਸٜ݅ө 🤔
ܻসޖীزചೡࣻחੌ ޖਸө 🚀
ܻসޖীزചೡࣻחੌ ޖਸө ഒࢲח൨ٜযਃ ೣԋٜ݅যਃ👫
언 ઁࠗఠࠈਸѐߊೡࣻաਃ
߄۽Ә
ӝࣿ۽ࢎࢤࢿਸטܻח҃
ӝࣿ۽ࢎࢤࢿਸטܻח҃ ழܻয৬ࢿҗܳݽفоઉоࣁਃ