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
100
개발자가 동료의 업무효율을 높이는 방법 | 슬랙봇 개념부터 개발까지
2024년 5월 7일 에어프레미아 내부 기술세션에서 발표한 슬랙봇 발표입니다.
슬랙봇이 무엇인지 기초 개념 설명부터 만드는 방법 코드까지 빠르게 살펴봅니다.
Seungmin 마량
May 07, 2024
Tweet
Share
More Decks by Seungmin 마량
See All by Seungmin 마량
좋은 서비스를 만들기 위한 제품팀 문화 이해하기
maryang
0
36
사수 없는 주니어 개발자가 성장하는 방법
maryang
0
270
개발자가 성과를 증명하는 방법 | A/B테스트 기반 개발
maryang
0
85
성장하는 스타트업이 사용하는 협업툴과 커뮤니케이션 방법
maryang
0
90
YOLO로 행복한 탑티어 개발자 되기
maryang
0
210
초 레거시 JSP 프로젝트를 최신 Next.js 13으로 마이그레이션 하기
maryang
0
67
Firebase에서 최신 Next.js를 사용하여 웹사이트 운영하기
maryang
0
250
겨울이 왔습니다. 저는 퇴사합니다.
maryang
0
110
Modern Android Development
maryang
0
73
Other Decks in Programming
See All in Programming
Vue3の一歩踏み込んだパフォーマンスチューニング2024
hal_spidernight
3
3k
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
0
220
Vue SFCのtemplateでTypeScriptの型を活用しよう
tsukkee
3
1.4k
リリース8年目のサービスの1800個のERBファイルをViewComponentに移行した方法とその結果
katty0324
2
3k
Vue.js学習の振り返り
hiro_xre
2
130
JaSST 24 九州:ワークショップ(は除く)実践!マインドマップを活用したソフトウェアテスト+活用事例
satohiroyuki
0
210
破壊せよ!データ破壊駆動で考えるドメインモデリング / data-destroy-driven
minodriven
15
3.8k
Re:proS_案内資料
rect
0
270
#pixiv小説画像メーカー はこうしてできた / The Making of the pixiv Novel Image Maker
roiban
0
240
飲食業界向けマルチプロダクトを実現させる開発体制とリアルな現状
hiroya0601
1
380
Nuxt UI Pro、NuxtHub、Nuxt Scripts、Nuxtエコシステムをふんだんに利用して開発するコーポレートサイト@Vue Fes Japan 2024
shingangan
3
850
Kubernetes for Data Engineers: Building Scalable, Reliable Data Pipelines
sucitw
1
180
Featured
See All Featured
Bash Introduction
62gerente
608
210k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
5
140
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9k
Agile that works and the tools we love
rasmusluckow
327
21k
Writing Fast Ruby
sferik
626
60k
Code Review Best Practice
trishagee
64
17k
Why Our Code Smells
bkeepers
PRO
334
57k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
3
360
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
106
49k
Measuring & Analyzing Core Web Vitals
bluesmoon
0
34
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Music & Morning Musume
bryan
46
6.1k
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ࠈࢎࢤࢿਸೱ࢚दఈפ
ޖटࠈਸٜ݅ө 🤔
ܻসޖীزചೡࣻחੌ ޖਸө 🚀
ܻসޖীزചೡࣻחੌ ޖਸө ഒࢲח൨ٜযਃ ೣԋٜ݅যਃ👫
언 ઁࠗఠࠈਸѐߊೡࣻաਃ
߄۽Ә
ӝࣿ۽ࢎࢤࢿਸטܻח҃
ӝࣿ۽ࢎࢤࢿਸטܻח҃ ழܻয৬ࢿҗܳݽفоઉоࣁਃ