SlideShare a Scribd company logo
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, Curator, Blogger
How to choose
programming language
• Easy to Write
• Fast in Run and
Compile
• Powerful Concurrency
• Powerful Built-in
Toolchain
Pokemon GO
Go is Fast
https://talks.golang.org/2014/gocon-tokyo.slide
gofmt / goimport
Before we look code
Before we look code (cont)
Gopher Taiwan Gathering #16:  Build a smart bot via Golang
Gopher Taiwan Gathering #16:  Build a smart bot via Golang
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 be something
like “
https://xxxxxx.hero
kuapp.com:443/cal
lback”
Fill your app dress here
Step 4. Get related Line Bot
info for Heroku App setting
• Need copy
following
variable:
• Channel ID
• Channel Secret
• MID
Need copy those three
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.
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
Gopher Taiwan Gathering #16:  Build a smart bot via Golang
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 invitation http://www.evanlin.com/line-bot-sdk-survey/
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股市小幫手”
Gopher Taiwan Gathering #16:  Build a smart bot via Golang
• 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/

More Related Content

What's hot (19)

PDF
How to master a programming language: a Golang example"
Evan Lin
 
PDF
Using the GitHub App to Connect to Bitbucket
Liam Dempsey
 
PPTX
GitLab 8.5 Highlights and Step-by-step tutorial
Heather McNamee
 
PDF
Using the GitHub App to Connect to Bitbucket
Liam Dempsey
 
PPTX
Using Git to Organize Your Project
Manish Suwal 'Enwil'
 
PPTX
The development workflow of git github for beginners
Gunjan Patel
 
PPTX
Provisioning environments. A simplistic approach
Eder Roger Souza
 
PDF
How Git and Gerrit make you more productive
Karsten Dambekalns
 
PDF
Git best practices workshop
Otto Kekäläinen
 
PDF
Golang for PHP programmers: A practical introduction
Richard Tuin
 
PPTX
Revolutionize Your Workflow with ChatOps
Tessa Mero
 
PDF
Git Ready! Workflows
Atlassian
 
PDF
O365Con18 - Git and GitHub - Rick van Rousselt
NCCOMMS
 
ODP
Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence
Parag Gajbhiye
 
PPTX
Introduction to git and Github
Wycliff1
 
PPTX
React Native
Fatih Şimşek
 
PDF
React.js: The hottest JS lib for building UIs
Stavros Bastakis
 
PPTX
Introduction to github slideshare
Rakesh Sukumar
 
How to master a programming language: a Golang example"
Evan Lin
 
Using the GitHub App to Connect to Bitbucket
Liam Dempsey
 
GitLab 8.5 Highlights and Step-by-step tutorial
Heather McNamee
 
Using the GitHub App to Connect to Bitbucket
Liam Dempsey
 
Using Git to Organize Your Project
Manish Suwal 'Enwil'
 
The development workflow of git github for beginners
Gunjan Patel
 
Provisioning environments. A simplistic approach
Eder Roger Souza
 
How Git and Gerrit make you more productive
Karsten Dambekalns
 
Git best practices workshop
Otto Kekäläinen
 
Golang for PHP programmers: A practical introduction
Richard Tuin
 
Revolutionize Your Workflow with ChatOps
Tessa Mero
 
Git Ready! Workflows
Atlassian
 
O365Con18 - Git and GitHub - Rick van Rousselt
NCCOMMS
 
Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence
Parag Gajbhiye
 
Introduction to git and Github
Wycliff1
 
React Native
Fatih Şimşek
 
React.js: The hottest JS lib for building UIs
Stavros Bastakis
 
Introduction to github slideshare
Rakesh Sukumar
 

Similar to Gopher Taiwan Gathering #16: Build a smart bot via Golang (7)

PDF
Introductions of Messaging bot 做聊天機器人
Johnny Sung
 
PDF
B 3 line bot live coding
LINE Corporation
 
PDF
Introduction to Chatbot Development for Facebook Messenger using Python
Muhamad Ishlah
 
PPTX
How to build a slack-hubot with js
Juneyoung Oh
 
PDF
Build your first messenger bot
Nowa Labs Pte Ltd
 
PPTX
Facebook Messenger Bot with Flask & Google App Engine
Nazrul Kamaruddin
 
PDF
Serverless Finland Meetup 16.11.2016: Messenger Bot Workshop
Mikael Puittinen
 
Introductions of Messaging bot 做聊天機器人
Johnny Sung
 
B 3 line bot live coding
LINE Corporation
 
Introduction to Chatbot Development for Facebook Messenger using Python
Muhamad Ishlah
 
How to build a slack-hubot with js
Juneyoung Oh
 
Build your first messenger bot
Nowa Labs Pte Ltd
 
Facebook Messenger Bot with Flask & Google App Engine
Nazrul Kamaruddin
 
Serverless Finland Meetup 16.11.2016: Messenger Bot Workshop
Mikael Puittinen
 
Ad

More from Evan Lin (14)

PDF
好書分享: 一人公司 Company Of One
Evan Lin
 
PPTX
How I become Go GDE
Evan Lin
 
PDF
iThome Modern Web 2018: 如何打造高效的機器學習平台
Evan Lin
 
PPTX
Kubernetes secret introduction
Evan Lin
 
PDF
Consistent hashing algorithmic tradeoffs
Evan Lin
 
PDF
GTG30: Introduction vgo
Evan Lin
 
PDF
Kubernetes v.s. mesos
Evan Lin
 
PDF
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
Evan Lin
 
PDF
iThome Cloud Summit: The next generation of data center: Machine Intelligent ...
Evan Lin
 
PDF
iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人
Evan Lin
 
PDF
Google APAC Machine Learning Expert Day
Evan Lin
 
PDF
Use go channel to write a disk queue
Evan Lin
 
PDF
Docker swarm introduction
Evan Lin
 
PDF
Docker introduction in Hardware Company
Evan Lin
 
好書分享: 一人公司 Company Of One
Evan Lin
 
How I become Go GDE
Evan Lin
 
iThome Modern Web 2018: 如何打造高效的機器學習平台
Evan Lin
 
Kubernetes secret introduction
Evan Lin
 
Consistent hashing algorithmic tradeoffs
Evan Lin
 
GTG30: Introduction vgo
Evan Lin
 
Kubernetes v.s. mesos
Evan Lin
 
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
Evan Lin
 
iThome Cloud Summit: The next generation of data center: Machine Intelligent ...
Evan Lin
 
iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人
Evan Lin
 
Google APAC Machine Learning Expert Day
Evan Lin
 
Use go channel to write a disk queue
Evan Lin
 
Docker swarm introduction
Evan Lin
 
Docker introduction in Hardware Company
Evan Lin
 
Ad

Recently uploaded (20)

PDF
Digital burnout toolkit for youth workers and teachers
asociatiastart123
 
PPTX
西班牙巴利阿里群岛大学电子版毕业证{UIBLetterUIB文凭证书}文凭复刻
Taqyea
 
PDF
Enhancing Parental Roles in Protecting Children from Online Sexual Exploitati...
ICT Frame Magazine Pvt. Ltd.
 
PDF
Top 10 Testing Procedures to Ensure Your Magento to Shopify Migration Success...
CartCoders
 
PDF
BRKACI-1001 - Your First 7 Days of ACI.pdf
fcesargonca
 
PDF
Boardroom AI: The Next 10 Moves | Cerebraix Talent Tech
ssuser73bdb11
 
PDF
FutureCon Seattle 2025 Presentation Slides - You Had One Job
Suzanne Aldrich
 
PDF
The Internet - By the numbers, presented at npNOG 11
APNIC
 
PPTX
Metaphysics_Presentation_With_Visuals.pptx
erikjohnsales1
 
PPTX
Orchestrating things in Angular application
Peter Abraham
 
PPTX
04 Output 1 Instruments & Tools (3).pptx
GEDYIONGebre
 
DOCX
Custom vs. Off-the-Shelf Banking Software
KristenCarter35
 
PPTX
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
PDF
BRKAPP-1102 - Proactive Network and Application Monitoring.pdf
fcesargonca
 
PPTX
PHIPA-Compliant Web Hosting in Toronto: What Healthcare Providers Must Know
steve198109
 
PPTX
Presentation3gsgsgsgsdfgadgsfgfgsfgagsfgsfgzfdgsdgs.pptx
SUB03
 
PPTX
Networking_Essentials_version_3.0_-_Module_5.pptx
ryan622010
 
PPTX
Networking_Essentials_version_3.0_-_Module_3.pptx
ryan622010
 
PDF
Cleaning up your RPKI invalids, presented at PacNOG 35
APNIC
 
PDF
BRKSP-2551 - Introduction to Segment Routing.pdf
fcesargonca
 
Digital burnout toolkit for youth workers and teachers
asociatiastart123
 
西班牙巴利阿里群岛大学电子版毕业证{UIBLetterUIB文凭证书}文凭复刻
Taqyea
 
Enhancing Parental Roles in Protecting Children from Online Sexual Exploitati...
ICT Frame Magazine Pvt. Ltd.
 
Top 10 Testing Procedures to Ensure Your Magento to Shopify Migration Success...
CartCoders
 
BRKACI-1001 - Your First 7 Days of ACI.pdf
fcesargonca
 
Boardroom AI: The Next 10 Moves | Cerebraix Talent Tech
ssuser73bdb11
 
FutureCon Seattle 2025 Presentation Slides - You Had One Job
Suzanne Aldrich
 
The Internet - By the numbers, presented at npNOG 11
APNIC
 
Metaphysics_Presentation_With_Visuals.pptx
erikjohnsales1
 
Orchestrating things in Angular application
Peter Abraham
 
04 Output 1 Instruments & Tools (3).pptx
GEDYIONGebre
 
Custom vs. Off-the-Shelf Banking Software
KristenCarter35
 
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
BRKAPP-1102 - Proactive Network and Application Monitoring.pdf
fcesargonca
 
PHIPA-Compliant Web Hosting in Toronto: What Healthcare Providers Must Know
steve198109
 
Presentation3gsgsgsgsdfgadgsfgfgsfgagsfgsfgzfdgsdgs.pptx
SUB03
 
Networking_Essentials_version_3.0_-_Module_5.pptx
ryan622010
 
Networking_Essentials_version_3.0_-_Module_3.pptx
ryan622010
 
Cleaning up your RPKI invalids, presented at PacNOG 35
APNIC
 
BRKSP-2551 - Introduction to Segment Routing.pdf
fcesargonca
 

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