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
64
좋은 서비스를 만들기 위한 제품팀 문화 이해하기
maryang
0
41
사수 없는 주니어 개발자가 성장하는 방법
maryang
0
280
개발자가 성과를 증명하는 방법 | A/B테스트 기반 개발
maryang
0
87
성장하는 스타트업이 사용하는 협업툴과 커뮤니케이션 방법
maryang
0
94
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
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
Macとオーディオ再生 2024/11/02
yusukeito
0
370
Ethereum_.pdf
nekomatu
0
470
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
110
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
340
Jakarta EE meets AI
ivargrimstad
0
140
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
100
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
A Tale of Four Properties
chriscoyier
156
23k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Speed Design
sergeychernyshev
25
620
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Happy Clients
brianwarren
98
6.7k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
A better future with KSS
kneath
238
17k
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ࠈࢎࢤࢿਸೱ࢚दఈפ
ޖटࠈਸٜ݅ө 🤔
ܻসޖীزചೡࣻחੌ ޖਸө 🚀
ܻসޖীزചೡࣻחੌ ޖਸө ഒࢲח൨ٜযਃ ೣԋٜ݅যਃ👫
언 ઁࠗఠࠈਸѐߊೡࣻաਃ
߄۽Ә
ӝࣿ۽ࢎࢤࢿਸטܻח҃
ӝࣿ۽ࢎࢤࢿਸטܻח҃ ழܻয৬ࢿҗܳݽفоઉоࣁਃ