Firebase + Bolt で もくもく会用のSlack botを作った話 / Build slack bot with firebase + Bolt

0a16f7b8629f2facca2a1e80a73c5423?s=47 ryo
August 26, 2020

Firebase + Bolt で もくもく会用のSlack botを作った話 / Build slack bot with firebase + Bolt

2020/08/26 フロンドエンドLT会 vol.1

BotやFirebaseの設定方法などはこちら。
https://qiita.com/ryo2132/items/1a7d5e2a1b80414700e3

0a16f7b8629f2facca2a1e80a73c5423?s=128

ryo

August 26, 2020
Tweet

Transcript

  1. 2020/08/26 ϑϩϯυΤϯυLTձ vol.1 @KawamataRyo Firebase + Bolt Ͱ ΋͘΋͘ձ༻ͷSlack botΛ࡞ͬͨ࿩

  2. ࣗݾ঺հ

  3. @KawamataRyo ιϑτ΢ΣΞΤϯδχΞ TypeScript, Ruby, Vue, Firebase

  4. @KawamataRyo ιϑτ΢ΣΞΤϯδχΞ TypeScript, Ruby, Vue, Firebase ফ๷࢜ྺ6೥൒, ΤϯδχΞྺ2೥൒

  5. ࠓ೔࿩͢͜ͱ

  6. * ΋͘΋͘ձ༻ͷSlack botͷ঺հ * Slack bot࡞੒ͷͭ·ΓͲ͜Ζ

  7. 1. ։ൃͷܦҢ

  8. ஍ݩɺἚ৓ݝͰΤϯδχΞͷษڧձΛओ࠵

  9. ਫށΤϯδχΞษڧձ ೔࣌ɿຖ݄ୈ2౔༵ 13:00ʙ18:00 ৔ॴɿἚ৓ݝਫށࢢ ܗࣜɿ΋͘΋͘ + LTձ

  10. ΋͘΋͘ճͷྲྀΕ

  11. 1. ࣗݾ঺հ & ΍Δ͜ͱઆ໌ 2. ΋͘΋͘λΠϜ 3. ੒Ռൃද

  12. 1. ࣗݾ঺հ & ΍Δ͜ͱઆ໌ 2. ΋͘΋͘λΠϜ 3. ੒Ռൃද ՝୊͋Γ!

  13. * ਓ਺͕ଟ͍ͱ֮͑ΒΕͳ͍ * ϑΥʔϚοτ͕ܾ·ͬͯͳ͍ͱ࿩ͮΒ͍ * ౤ߘ͕ྲྀΕͯ͠·ͬͯ୳͠ਏ͍

  14. * ਓ਺͕ଟ͍ͱ֮͑ΒΕͳ͍ * ϑΥʔϚοτ͕ܾ·ͬͯͳ͍ͱॻ͖ਏ͍ * ౤ߘ͕ྲྀΕͯ͠·ͬͯ୳͠ਏ͍ ςΩετͰ࢒͢ ઐ༻ϑΥʔϜΛ࡞੒͢Δ ಠࣗʹϑΥʔϚοτͯ͠౤ߘ

  15. Slack workflow͕͋Δ!!

  16. ແྉ൛ͳͷͰ࢖͑·ͤΜ..

  17. Slack botΛ࡞Δͧ !!!

  18. 2. ࡞ͬͨ΋ͷ

  19. DEMO

  20. γεςϜߏ੒

  21. Bolt-js Slack APIΛ࢖͍΍͘͢͢ΔͨΊͷ Node.jsͷϑϨʔϜϫʔΫɻ؆୯ʹ Slack Event APIΛѻ͏ػೳ౳͕ ఏڙ͞Ε͍ͯΔ

  22. Cloud Functions for Firebase GCPͷCloud FunctionsͷFirebase൛ ػೳతʹ͸΄΅ಉ͡ɻ ΠϕϯτυϦϒϯͰεέʔϥϒϧͳؔ਺ Λ࣮ߦͰ͖Δɻ

  23. Firestore εέʔϥϒϧͳυΩϡϝϯτࢦ޲σʔλ ϕʔεɻNoSQLɻڧྗͳϦΞϧλΠϜॲ ཧΛ΋ͭɻ

  24. Slack Functions + Bolt Firestore Firebase

  25. Slack Functions + Bolt Firestore Firebase slash commands

  26. Slack Functions + Bolt Firestore Firebase աڈͷ౤ߘऔಘ

  27. Slack Functions + Bolt Firestore Firebase Ϟʔμϧىಈ

  28. Slack Functions + Bolt Firestore Firebase Formૹ৴

  29. Slack Functions + Bolt Firestore Firebase ౤ߘه࿥

  30. Slack Functions + Bolt Firestore Firebase formatͯ͠౤ߘ

  31. 3. ͭ·ΓͲ͜Ζ

  32. ॳճ͸ى͖Δ·Ͱ͕͔͔࣌ؒΔ

  33. Firebase Functions͸ॳճىಈ͕஗͍ͷͰɺslackଆͰ timeout errorͱͳΔɻ ࣄલʹԹΊ͓ͯ͘͜ͱ͕େࣄɻ

  34. Firebase ͱ Bolt ͱͷ૬ੑ

  35. FaaSͰಈ͔͢ͳΒ processBeforeResponse: true ͕ඞਢɻ ͜ΕΛઃఆ͠ͳ͍ͱඇಉظॲཧͰਖ਼ৗʹಈ͔ͳ͍ɻ

  36. 4. ͓ΘΓʹ

  37. * Bolt + Firebase FunctionsͰBot͸खܰʹ࡞ΕΔ * ษڧձ։࠵લʹBotΛԹΊ͓ͯ͜͏ * processBeforeResponseͷઃఆΛ๨Εͣʹ!

  38. https://qiita.com/ryo2132/items/1a7d5e2a1b80414700e3