分報のTLをSlackBoltFrameworkでさくっと作ってみた

16d82c13c5ef30af8954b76b106ddf29?s=47 75asa
February 13, 2020

 分報のTLをSlackBoltFrameworkでさくっと作ってみた

16d82c13c5ef30af8954b76b106ddf29?s=128

75asa

February 13, 2020
Tweet

Transcript

  1. Nago Asato ෼ใͷ5- CPMUͰͭͬͯ͘ΈͨΜ͝

  2. me גࣜձࣾλϯόϦϯ Ϋϥ΢υɾσϕϩούʔ SalesforceͷόοΫΤϯυ։ൃʢAPEXʣ Laravel΍NodeɺTypeScriptͰ৭ʑ΍ͬͨΓ ΩʔϘʔυ഑ྻ͸USʢHHKBʣ ͦͯ͠ΏΔ;ΘVimmer

  3. ෼ใ ࢖ͬͯ·͔͢ʁ

  4. ෼ใͱ͸ suin͞Μ, ͹Μ͘͠͞Μ ᐌ͘ ෼ใ a.k.a.ʮtimes_*, r_*,ʯ ͱ͸ɺࣾ಺νϟοτ౳Ͱࣗ෼ͷνϟ ϯωϧΛ࣋ͪɺ୹͍εύϯͰൃݴ ͢Δࣾ಺TwitterͷΑ͏ͳจԽܗଶ

  5. ϝϦοτ ɾ৺ཧతͳؾܰ͞ ɾٕज़తͳϨϕϧ͕ࠩߟྀ͞Ε΍͍͢ ɾ೔Ұճͷ೔ใʹൺֱ͢Ε͹෼୯ҐͰࠁΊΔϦΞϧλΠϜੑ ɾ҉໧஌ΛಘΔ͖͔͚ͬʹͳΓ΍͍͢ ɾίϛϡχέʔγϣϯɾΤϯήʔδϝϯτ

  6. σϝϦοτ ɾҪށ୺ձٞ ɾਓ਺ʹରͯ͠εέʔϧ͠ͳ͍ ɾঝೝཉٻΛܹࢗ͢Δ

  7. ͱ͍͏͜ͱ͸

  8. TL࡞Ε͹ղܾ͢ΔͷͰ͸

  9. ͱ͍͏Θ͚Ͱ࡞ͬͯΈͨ

  10. ։ൃ؀ڥ • Node JS 11x • Slack Bolt Framework •

    PaaS͸Heroku
  11. Bolt ⚡ͱ͸ • Bolt ͸ Slack API Λ࢖͍΍͘͢͢ΔͨΊͷ Node.js ϑ

    ϨʔϜϫʔΫͰ͢ɻ Ұ͔Β API Λ࢖ͬͯΞϓϦΛ։ൃͯ͠ ͍͘͜ͱͱൺ΂Δͱɺ͜ͷϑϨʔϜϫʔΫΛ࢖͏ͱ΋ͬͱ αΫͬͱ࡞͍ͬͯ͘͜ͱ͕Ͱ͖Δͱࢥ͍·͢ɻ @girlie_mac ͞ΜͷQiitaهࣄΑΓҾ༻
  12. slackAppͭ͘Δ

  13. TMBDLBQJαΠτ΁ ΞϓϦ࡞Δ࣌͸ IUUQTBQJTMBDLDPNBQQT #PMUͷνϡʔτϦΞϧ IUUQTTMBDLEFWCPMUKBKQUVUPSJBMHFUUJOH TUBSUFE

  14. ϩʔΧϧ։ൃ

  15. • yarn͔npmͰ @slack/bolt ೖΕΔ • ϩʔΧϧ։ൃ͸ ngrokΛ࢖͏ • slackAppͷϦΫΤετURLʹngrokͷ΍ͭΛ࿈ܞ

  16. ࣮ࡍͷίʔυ

  17. channelsͷܕ

  18. infoͷܕ

  19. ͕͍͍͜͜Α bolt͞Μ • Slack api ͕RequestURL΍Payload͝ʹΐ͝ʹΐ͠ͳͯ͘ ΋؆୯ʹ࢖͑Δʂ • api ͷܕ৘ใ͕ḷΕ͹Θ͔Δʢৄࡉ͸υΩϡϝϯτͰʣ

    • ϩʔΧϧ։ൃ͕݁ߏ͸͔ͲΔ
  20. attachment ? block ? • Slack apiͷattachmentʹ୅ΘΔ΍ͭ • attachmentͷෳࡶͳ࢓༷Λγϯϓϧʹͨ͠΋ͷ •

    attachmentΑΓRichͳΠϯλʔϑΣʔεΛ࣮૷Ͱ͖Δ • Block kit builder (GUI) ͰI/FΛ֬ೝ͠ͳ͕ΒJSON֬ೝ
  21. Block kit Builder

  22. ؾʹͳΔͱ͜ • Slack ެࣜAPIͱ͸ผʹbolt clientͰAPI࢖͏ࡍʹdocཉ͍͠ • Block kit ͰͰ͖Δ͜ͱͱattachmentͰͰ͖Δ͜ͱ͕෼͔Γ ͮΒ͍

  23. Ͱ͖ͨ΋ͷ

  24. ·ͱΊ ɾ#PMU͸ָ͍͠ ɾ#MPDL,JU͍͍Ͷ ɾϩʔΧϧ։ൃָ͕ ɾίʔϙϨʔτΤϯδχΞϦϯάָ͍͠ ɾ5-ͷݟա͗͸ې෺ɺϑϧεϥοΫΤϯδχΞͳͬͯ·͏

  25. Links UJNFMJOFSฐࣾͰೖΕͯΔ4MBDL"QQ IUUQTHJUIVCDPNOBTBUUJNFMJOFS TMBDLCPMUGSBNFXPSL IUUQTHJUIVCDPNTMBDLBQJCPMU TMBDLCMPDLLJUνϡʔτϦΞϧ IUUQTBQJTMBDLDPNMBOHKBKQTMBTICMPDLLJU TVJO͞Μͷ෼ใͱ͸ IUUQDFDPN ͹Μ͘͠͞Μͷ෼ใͷޮೳ·ͱΊ

    IUUQTOPUFDPNWBBBBBORVJTIOODDDGF
  26. ͋Γ͕ͱ͏͍͟͝·ͨ͠