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
11
좋은 서비스를 만들기 위한 제품팀 문화 이해하기
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
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
160
cXML という電子商取引の トランザクションを支える プロトコルと向きあっている話
phigasui
3
2.3k
推し活の ハイトラフィックに立ち向かう Railsとアーキテクチャ - Kaigi on Rails 2024
falcon8823
6
2.4k
開発効率向上のためのリファクタリングの一歩目の選択肢 ~コード分割~ / JJUG CCC 2024 Fall
ryounasso
0
390
EventSourcingの理想と現実
wenas
6
2.1k
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.1k
OpenTelemetryでRailsのパフォーマンス分析を始めてみよう(KoR2024)
ymtdzzz
5
1.8k
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
280
外部システム連携先が10を超えるシステムでのアーキテクチャ設計・実装事例
kiwasaki
1
240
offers_20241022_imakiire.pdf
imakurusu
2
370
色々なIaCツールを実際に触って比較してみる
iriikeita
0
290
ECSのサービス間通信 4つの方法を比較する 〜Canary,Blue/Greenも添えて〜
tkikuc
11
2.3k
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1366
200k
Measuring & Analyzing Core Web Vitals
bluesmoon
2
53
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
43
6.6k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
330
It's Worth the Effort
3n
183
27k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
23k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Optimizing for Happiness
mojombo
376
69k
BBQ
matthewcrist
85
9.3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Building an army of robots
kneath
302
42k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
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ࠈࢎࢤࢿਸೱ࢚दఈפ
ޖटࠈਸٜ݅ө 🤔
ܻসޖীزചೡࣻחੌ ޖਸө 🚀
ܻসޖীزചೡࣻחੌ ޖਸө ഒࢲח൨ٜযਃ ೣԋٜ݅যਃ👫
언 ઁࠗఠࠈਸѐߊೡࣻաਃ
߄۽Ә
ӝࣿ۽ࢎࢤࢿਸטܻח҃
ӝࣿ۽ࢎࢤࢿਸטܻח҃ ழܻয৬ࢿҗܳݽفоઉоࣁਃ