Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Golang Taipei Gathering #16
Using Golang to build smart IM Bot
Evan Lin @LinkerNetworks
About Me
• Cloud Architect @ Linker
Networks
• Top 10 Taiwan Golang
open source contributor
(github award)
• Developer, Cu...
How to choose
programming language
• Easy to Write
• Fast in Run and
Compile
• Powerful Concurrency
• Powerful Built-in
To...
Pokemon GO
Go is Fast
https://talks.golang.org/2014/gocon-tokyo.slide
gofmt / goimport
Before we look code
Before we look code (cont)
After file save..
GoMobile
Original Work Flow
Golang
Sample Console
Sometime Failed
Work
Failed on Some
Model
GoMobile
Using Golang in Mobile
Golang
GoMobile
Package
Golang
Sample Console
Golang IDE
(Integrated Development Environment)
Visual Studio Code Go Extension
Build IM Line Bot
Step 1: Request Line Bot Trial
Account
Apply Line Bot trial account here
(Only 1 per Line Account)
Step 2: Deploy to Heroku by
one click
Link :
https://github.com/kkdai/LineBotTemplate
Step 2: Deploy to Heroku by
one click
Remember this address
Step 3. Fill your Heroku App
Callback address to Line Bot
• Copy your app
address from
Heroku to Line
Dashboard.
• It will...
Step 4. Get related Line Bot
info for Heroku App setting
• Need copy
following
variable:
• Channel ID
• Channel Secret
• M...
Step 5. Fill your Line Bot
Information to Heroku
Variables
• In Heroku [Dashboard] ->
[Settings]-> [Config
Variables]
• Cr...
Send a Image to user
Parse bot request to received
result
Send a Image to user
Make sure it is text message not
operation
Send a Image to user
Send image to who text to the
bot
“Hello” message from Line
Bot
Hello
Send a “Hello” message when add bot as
friend
Determine the operation type
Expect Result Actual Result
No “id” and “from” in “content”.
We need use the value from “param[0]”
to find who send the in...
Send a “Hello” message when add bot as
friend
Get request from ID, this is only way for
now
Example: PetNeedMe
https://github.com/kkdai/LineBotPetNeedM
e
Build Facebook Bot
Step 1: Deploy to Heroku
Link :
https://github.com/kkdai/FBBotTemplate
Remember this address
Step 2: Create Facebook
Page
Step 3: Create App for
Messenger
• Create new app
“Web App”
• Select new
product
“Messenger”
Step 4: Create App Token
• Select generate
token.
• Need a “Page”
Step 5: Paste token to
Heroku Variable
Step 6: Setup Page
Subscription for Messenger Bot
https://APP_ADDRESS.herokuapp.com/webhoo
k
Token we just
generate
Step 7: Select a Page for
your Webhooks
Step 8: Select a Page for
your Webhooks
Example: PetNeedMe
你的 IM 機器人夠聰明嗎?
IM Bot 10 years ago
“有問必達”
圖片重灌狂人:
https://briian.com/2536/msn-bot.html
IM Bot 10 years later
“Fugle股市小幫手”
• Left Brain
• Logical
• Verbal
• Language
台北天氣如何?
台北天氣如何?
台北有下雨嗎?
台北天氣如何?
台
北
冷
嗎
?
台
北
天
氣
好
嗎
?
台
北
天
氣
怎
麼
樣
?
台北天空是什麼顏色?
台北有下雨嗎?
去台北需要帶傘嗎?
台北天氣如何?
Intent: ??
Entity: ??
台北天氣如何?
Intent: Check Weather
Entity: ??
台北天氣如何?
Intent: Check Weather
Entity: Taipei
Use LUIS to build smart
Bot
Use LUIS to build smart
Bot
LUIS
Other Natural Language
Processing Tool
Future
Future :
Bot to Bot (No more API)
Future :
Customer Service Bot
http://www.mobile01.com/topicdetail.php?f=383&t=407842
Future :
For Your Website and
Business
Future :
For Your Website and
Business
Future :
How About Build Right Brain?
We are Hiring..
1. Senior Data ScientistFr
2. Senior Front-end
歡迎訂閱 碼天狗
http://weekly.codetengu.com/
Gopher Taiwan Gathering #16:  Build a smart bot via Golang
Gopher Taiwan Gathering #16:  Build a smart bot via Golang
Gopher Taiwan Gathering #16:  Build a smart bot via Golang
Gopher Taiwan Gathering #16:  Build a smart bot via Golang
Upcoming SlideShare
Loading in …5
×

Gopher Taiwan Gathering #16: Build a smart bot via Golang

359 views

Published on

Just a talk to describe how to use Golang to Build IM Bot with LUIS.

Published in: Internet
  • Be the first to comment

Gopher Taiwan Gathering #16: Build a smart bot via Golang

  1. 1. Golang Taipei Gathering #16 Using Golang to build smart IM Bot Evan Lin @LinkerNetworks
  2. 2. About Me • Cloud Architect @ Linker Networks • Top 10 Taiwan Golang open source contributor (github award) • Developer, Curator, Blogger
  3. 3. How to choose programming language • Easy to Write • Fast in Run and Compile • Powerful Concurrency • Powerful Built-in Toolchain
  4. 4. Pokemon GO
  5. 5. Go is Fast
  6. 6. https://talks.golang.org/2014/gocon-tokyo.slide
  7. 7. gofmt / goimport
  8. 8. Before we look code
  9. 9. Before we look code (cont)
  10. 10. After file save..
  11. 11. GoMobile Original Work Flow Golang Sample Console Sometime Failed Work Failed on Some Model
  12. 12. GoMobile Using Golang in Mobile Golang GoMobile Package Golang Sample Console
  13. 13. Golang IDE (Integrated Development Environment) Visual Studio Code Go Extension
  14. 14. Build IM Line Bot
  15. 15. Step 1: Request Line Bot Trial Account Apply Line Bot trial account here (Only 1 per Line Account)
  16. 16. Step 2: Deploy to Heroku by one click Link : https://github.com/kkdai/LineBotTemplate
  17. 17. Step 2: Deploy to Heroku by one click Remember this address
  18. 18. 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.hero kuapp.com:443/cal lback” Fill your app dress here
  19. 19. Step 4. Get related Line Bot info for Heroku App setting • Need copy following variable: • Channel ID • Channel Secret • MID Need copy those three
  20. 20. 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.
  21. 21. Send a Image to user Parse bot request to received result
  22. 22. Send a Image to user Make sure it is text message not operation
  23. 23. Send a Image to user Send image to who text to the bot
  24. 24. “Hello” message from Line Bot Hello
  25. 25. Send a “Hello” message when add bot as friend Determine the operation type
  26. 26. Expect Result Actual Result No “id” and “from” in “content”. We need use the value from “param[0]” to find who send the invitation http://www.evanlin.com/line-bot-sdk-survey/
  27. 27. Send a “Hello” message when add bot as friend Get request from ID, this is only way for now
  28. 28. Example: PetNeedMe https://github.com/kkdai/LineBotPetNeedM e
  29. 29. Build Facebook Bot
  30. 30. Step 1: Deploy to Heroku Link : https://github.com/kkdai/FBBotTemplate
  31. 31. Remember this address
  32. 32. Step 2: Create Facebook Page
  33. 33. Step 3: Create App for Messenger • Create new app “Web App” • Select new product “Messenger”
  34. 34. Step 4: Create App Token • Select generate token. • Need a “Page”
  35. 35. Step 5: Paste token to Heroku Variable
  36. 36. Step 6: Setup Page Subscription for Messenger Bot https://APP_ADDRESS.herokuapp.com/webhoo k Token we just generate
  37. 37. Step 7: Select a Page for your Webhooks
  38. 38. Step 8: Select a Page for your Webhooks
  39. 39. Example: PetNeedMe
  40. 40. 你的 IM 機器人夠聰明嗎?
  41. 41. IM Bot 10 years ago “有問必達” 圖片重灌狂人: https://briian.com/2536/msn-bot.html
  42. 42. IM Bot 10 years later “Fugle股市小幫手”
  43. 43. • Left Brain • Logical • Verbal • Language
  44. 44. 台北天氣如何?
  45. 45. 台北天氣如何? 台北有下雨嗎?
  46. 46. 台北天氣如何? 台 北 冷 嗎 ? 台 北 天 氣 好 嗎 ? 台 北 天 氣 怎 麼 樣 ? 台北天空是什麼顏色? 台北有下雨嗎? 去台北需要帶傘嗎?
  47. 47. 台北天氣如何? Intent: ?? Entity: ??
  48. 48. 台北天氣如何? Intent: Check Weather Entity: ??
  49. 49. 台北天氣如何? Intent: Check Weather Entity: Taipei
  50. 50. Use LUIS to build smart Bot
  51. 51. Use LUIS to build smart Bot
  52. 52. LUIS
  53. 53. Other Natural Language Processing Tool
  54. 54. Future
  55. 55. Future : Bot to Bot (No more API)
  56. 56. Future : Customer Service Bot http://www.mobile01.com/topicdetail.php?f=383&t=407842
  57. 57. Future : For Your Website and Business
  58. 58. Future : For Your Website and Business
  59. 59. Future : How About Build Right Brain?
  60. 60. We are Hiring.. 1. Senior Data ScientistFr 2. Senior Front-end
  61. 61. 歡迎訂閱 碼天狗 http://weekly.codetengu.com/

×