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

Modern Web 2016: Using Golang to build a smart ...

Evan Lin
August 17, 2016

Modern Web 2016: Using Golang to build a smart IM Bot

A talk for modern web 2016 to introduce how to use Golang to write a smart IM Bot

Evan Lin

August 17, 2016
Tweet

More Decks by Evan Lin

Other Decks in Technology

Transcript

  1. Agenda • Introduce Golang • Build Line Bot • Build

    FB Bot • Build a smart IM Bot • Future • Q&A
  2. About Me • Cloud Architect @ Linker Networks • Top

    10 Taiwan Golang open source contributor (github award) • Developer, Curator, Blogger
  3. What is Go(lang) • Create by Google • Design by

    • Ken Thompson • Rob Pike • Robert Griesemer, • Feature: • Compiled • Statically Typed • Garbage Collection
  4. Step 1: Request Line Bot Trial Account Apply Line Bot

    trial account here (Only 1 per Line Account)
  5. Step 2: Deploy to Heroku by one click Link :

    https://github.com/kkdai/LineBotTemplate
  6. Step 3. Fill your Heroku App Callback address to Line

    Bot • Copy your app address from Heroku to Line Dashboard. • It will be something like “ https:// xxxxxx.herokuapp. com:443/callback” Fill your app dress here
  7. Step 4. Get related Line Bot info for Heroku App

    setting • Need copy following variable: • Channel ID • Channel Secret • MID Need copy those three
  8. Step 5. Fill your Line Bot Information to Heroku Variables

    • In Heroku [Dashboard] -> [Settings]-> [Config Variables] • Create following variables: • ChannelID • ChannelSecret • MID • Fill with you just got from Line Bot Dashboard.
  9. Send a “Hello” message when add bot as friend Get

    request from ID, this is only way for now
  10. Step 3: Create App for Messenger • Create new app

    “Web App” • Select new product “Messenger”
  11. ݣ玖ॠ穥ই֜? ݣ 玖 獖 㻟 ? ݣ 玖 ॠ 穥

    অ 㻟 ? ݣ 玖 ॠ 穥 ெ 讕 䰬 ? ݣ玖ॠ绚ฎՋ讕氅ᜋ? ݣ玖磪ӥ襁㻟? ݄ݣ玖襑ᥝ癲㯩㻟?
  12. \