Upgrade to Pro — share decks privately, control downloads, hide ads and more …

さわやか待ち時間LINE botを作った話 / Sawayaka LINE bot

muttan
January 25, 2020

さわやか待ち時間LINE botを作った話 / Sawayaka LINE bot

#ふくもく会
#SawayakaMeetup

muttan

January 25, 2020
Tweet

More Decks by muttan

Other Decks in Programming

Transcript

  1. ͓લ୭Αʁ • ෱Ҫେֶ޻ֶݚڀՊ M2 • ΦλΫ • aikoͱҏ౻ඒདྷͷ࿩͹͔Γͯ͠Δ • TwitterͷΞΧ΢ϯτ໊͕සൟʹ

    มΘΔ͜ͱͰ༗໊ • Ͱ΋େମʮ͘·͞Μʯͬͯݺ͹ Εͯ·͢ Kamiya Keisuke a.k.a kuma @bath_poo_
  2. ͞Θ΍͔ͷ଴ͪ࣌ؒ໰୊ • ͛Μͭ͜ϋϯόʔά͸༗໊ʹͳΓ͗ͨ͢ • ͋Δళฮ͸GW͸6h଴ͪʹͳͬͨͱ͔ͳΜͱ͔ • ʢҰ෦ళฮΛআ͍ͯʣฏ೔Ͱ͋Ε͹͋·Γؾʹͤͣʹߦͬ ͯ΋ͬ͢ͱ৯΂ΒΕΔ • ౔೔͸ൺֱతࠞΜͰ͍Δ͜ͱ͕ଟ͍

    • ൟ๩ظʢGWɼ೥຤೥࢝ɼۙลͰͷϥΠϒΠϕϯτʣ͸ ࣌ؒ଴ͪ( )ʹͳΔ͜ͱ΋βϥ → ͳΔ΂͘ళฮͰͷ଴ͪ࣌ؒΛݮΒ͍ͨ͠ → ͔͠͠ళฮʹߦͬͯ଴ͪ࣌ؒΛ֬ೝ͢Δͷ͸໘౗ N N ≥ 1
  3. ΞʔΩςΫνϟ • Messaging APIͷWebhook༻ͷαʔό͸HerokuͰϗεςΟ ϯά → Go + Go modules੡

    • Ϋϩʔϥʔ΋HerokuͰϗεςΟϯά(3෼ʹ1ճऔಘ) → Python + pipenv੡ • ݕࡧΛͲ͏͢Δ͔໎͕ͬͨɼ͢΂ͯͷࢥߟΛ์غͯ͠ Algoliaʹ͢΂ͯ౤͛ͨ → ϥΠϒϥϦ΋υΩϡϝϯτ΋ॆ࣮͍ͯͯ͠։ൃ͕εϜʔζ ʹਐΜͩ https://speakerdeck.com/shinodogg/introducing-algolia-with-demo
  4. ·ͱΊ • ͞Θ΍͔ͷ଴ͪ࣌ؒΛڭ͑ͯ͘ΕΔLINE botΛॻ͍ͨ • GoͱPythonͱHerokuͱAlgoliaͰ࡞੒ • LINE bot SDKͱAlgolia

    SDK͕ΊͪΌͪ͘Ό࢖͍΍͢ ͔ͬͨͷͰγϡοͱ࡞Δ͜ͱ͕Ͱ͖Δ • ݱࡏ஍͔Βྑ͛͞ళฮΛαδΣετ͢Δػೳͱ͔͋Δ ͱ͍͍Ͷͬͯࢥ͍·ͨ͠ ‣ Ͱ͖ͦ͏ɼAlgoliaͳΒͶ