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
110
개발자가 동료의 업무효율을 높이는 방법 | 슬랙봇 개념부터 개발까지
2024년 5월 7일 에어프레미아 내부 기술세션에서 발표한 슬랙봇 발표입니다.
슬랙봇이 무엇인지 기초 개념 설명부터 만드는 방법 코드까지 빠르게 살펴봅니다.
Seungmin 마량
May 07, 2024
Tweet
Share
More Decks by Seungmin 마량
See All by Seungmin 마량
30살에 구글이 인정한 개발자가 될 수 있었던 공부법
maryang
0
6
좋은 서비스를 만들기 위한 제품팀 문화 이해하기
maryang
0
38
사수 없는 주니어 개발자가 성장하는 방법
maryang
0
270
개발자가 성과를 증명하는 방법 | A/B테스트 기반 개발
maryang
0
85
성장하는 스타트업이 사용하는 협업툴과 커뮤니케이션 방법
maryang
0
91
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
go.mod、DockerfileやCI設定に分散しがちなGoのバージョンをまとめて管理する / Go Connect #3
arthur1
10
2.4k
macOS でできる リアルタイム動画像処理
biacco42
8
2.1k
推し活としてのrails new/oshikatsu_ha_iizo
sakahukamaki
3
1.8k
Kotlin2でdataクラスの copyメソッドを禁止する/Data class copy function to have the same visibility as constructor
eichisanden
1
150
Hotwire or React? ~Reactの録画機能をHotwireに置き換えて得られた知見~ / hotwire_or_react
harunatsujita
9
4.4k
VR HMDとしてのVision Pro+ゲーム開発について
yasei_no_otoko
0
110
Android 15 でアクションバー表示時にステータスバーが白くなってしまう問題
tonionagauzzi
0
150
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
0
170
デプロイを任されたので、教わった通りにデプロイしたら障害になった件 ~俺のやらかしを越えてゆけ~
techouse
52
33k
讓數據說話:用 Python、Prometheus 和 Grafana 講故事
eddie
0
370
Quine, Polyglot, 良いコード
qnighy
3
430
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
3
310
Featured
See All Featured
Unsuck your backbone
ammeep
668
57k
Six Lessons from altMBA
skipperchong
26
3.5k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
The Pragmatic Product Professional
lauravandoore
31
6.3k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
355
29k
Building Adaptive Systems
keathley
38
2.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
32
1.8k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Building Better People: How to give real-time feedback that sticks.
wjessup
363
19k
For a Future-Friendly Web
brad_frost
175
9.4k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
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ࠈࢎࢤࢿਸೱ࢚दఈפ
ޖटࠈਸٜ݅ө 🤔
ܻসޖীزചೡࣻחੌ ޖਸө 🚀
ܻসޖীزചೡࣻחੌ ޖਸө ഒࢲח൨ٜযਃ ೣԋٜ݅যਃ👫
언 ઁࠗఠࠈਸѐߊೡࣻաਃ
߄۽Ә
ӝࣿ۽ࢎࢤࢿਸטܻח҃
ӝࣿ۽ࢎࢤࢿਸטܻח҃ ழܻয৬ࢿҗܳݽفоઉоࣁਃ