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
Firebase + BoltではじめるSlackアプリ開発
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
mako_makok
November 21, 2020
Technology
15k
0
Share
Firebase + BoltではじめるSlackアプリ開発
この資料は2020/11/18に行われた、「自動化大好きエンジニアLT会」の発表資料です。
https://rakus.connpass.com/event/192101/
mako_makok
November 21, 2020
More Decks by mako_makok
See All by mako_makok
Kotlinにおける型の世界と エラーハンドリング / Type World and Error Handling in Kotlin
makomakok
3
1.2k
Javaでも使えるKotlin OSSを目指すためのkotlin.jvmの利用とインターフェース設計/Use of kotlin.jvm and interface design for Kotlin OSS that can also be used in Java
makomakok
0
930
Slack_API_Wrapper_BoltでBotを爆速開発.pdf
makomakok
0
350
退屈なことはバッチにやらせよう
makomakok
1
640
Other Decks in Technology
See All in Technology
Practical TypeProf: Lessons from Analyzing Optcarrot
mame
0
1.1k
AIでAIをテストする - 音声AIエージェントの品質保証戦略
morix1500
1
140
AI時代における技術的負債への取り組み
codenote
1
1.7k
MLOps導入のための組織作りの第一歩
akasan
0
370
音声言語モデル手法に関する発表の紹介
kzinmr
0
130
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.4k
20年前の「OSS革命」に学ぶ AI時代の生存戦略
samakada
0
480
The Journey of Box Building
tagomoris
4
3.4k
Cortex Codeのコスト見積ヒントご紹介
yokatsuki
0
110
コードや知識を組み込む / Incorporate Code and Knowledge
ks91
PRO
0
170
基盤を育てる 外部SaaS連携の運用
gamonges_dresscode
1
120
Arcana: Production-Ready RAG in Elixir @ ElixirConf EU 2026
georgeguimaraes
0
110
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
480
Why Our Code Smells
bkeepers
PRO
340
58k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
230
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
280
How to Ace a Technical Interview
jacobian
281
24k
Crafting Experiences
bethany
1
120
The Cult of Friendly URLs
andyhume
79
6.8k
What's in a price? How to price your products and services
michaelherold
247
13k
Code Reviewing Like a Champion
maltzj
528
40k
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
140
Transcript
Firebase + Boltで始める 自動化のススメ @mako_makok 2020/11/18 自動化大好きエンジニア LT会
自己紹介 • 名前: 小林允(@mako_makok) • 所属: 株式会社ラクス • メインはバックエンドエンジニア •
フロントエンドもかじってる • Spring/Java/Kotlin/TypeScript/React
勉強会の情報を毎日通知してくれるSlackアプリを 作った
None
使ったもの • Cloud Functions(Firebase) • Firebase FireStore • Bolt For
JavaScript
Cloud Functions For Firebase • イベントをトリガーにしてバックエンドのコードを実行 • 200万/月 イベントまで無料 •
有料プラン(Blaze)じゃないと使えない
Firestore • NoSQL データベース • 無料プラン(Spark)でも使える • 容量: 1GB •
Read: 50000/日 • Write, Delete: それぞれ20000/日
正直botレベルでこんなに使わないので実質無料
Bolt For JavaScript • Slackアプリ構築用のフレームワーク • Slack API Team謹製 •
Slack API Client + Receiver + 便利な型定義 • TypeScriptで書かれている • For JavaScriptとあるだけあり多言語のSDKも提供されている ◦ Python, Java
Firestore slash command でモーダル 表示をRequest Functions モーダルを返却
Firestore slash command でモーダル 表示をRequest モーダルを生成 Formを送信 Formの内容を登録 Functions
Firestore slash command でモーダル 表示をRequest モーダルを返却 Formを送信 Formの内容を登録 Functions 1.
ユーザごとのパラ メータを取得 2. APIを叩く 3. webhookでそれぞれ のユーザにDM送信
なぜFirebase? • 他のmBaaSだとAWS Amplifyがある ◦ ちょっと前までAmplifyにはemulatorがなかった ▪ 今はAmplifyにもlocal emulatorがある ◦
AmplifyだとAppSyncがある ▪ Slack bot開発では特に使う必要がない • 個人的にFirebaseのほうが慣れている
Boltの利点 • slackアプリ作成に必要なものが全部入ってくる ◦ Receiver(express)も内包されているので別途インストールの必要 なし • 便利な関数 ◦ ack()
◦ say() ◦ etc... export const expressReceiver = new ExpressReceiver ({ signingSecret: config.slack.secret, endpoints: '/events', processBeforeResponse: true }) export const app = new App({ receiver: expressReceiver , token: config.slack.token, processBeforeResponse: true })
Bolt for JavaScriptの利点 • Slackアプリのviewを作成するBlock Kitという仕組みがある ◦ section一個につきプロパティ5~10個程度書くので物量がある • 便利な型定義
◦ Blockの型定義 ◦ 他にもSlackは色々できる分Payloadが長くなりがち ◦ 型定義のおかげで補完を効かせながら書ける
None
FaaSでBolt利用時の注意点 export const expressReceiver = new ExpressReceiver({ signingSecret: config.slack.secret, endpoints:
'/events', processBeforeResponse: true }) これをつけ忘れない!
まとめ • Firebaseでは安く簡単で早くアプリ開発ができる • Boltを使うことでSlackアプリ開発に集中できる • processBeforeResponseは絶対に忘れないようにしましょう(戒め)