Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Chatterbot
Search
Tomohiro Taira
December 04, 2012
Programming
0
460
Chatterbot
I'm created the Kris. Kris is a Ruby IRC bot library.
https://github.com/Tomohiro/kris
Tomohiro Taira
December 04, 2012
Tweet
Share
More Decks by Tomohiro Taira
See All by Tomohiro Taira
Go Package Development
tomohiro
1
1.1k
Awesome LAMP
tomohiro
1
410
Other Decks in Programming
See All in Programming
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
210
Remix on Hono on Cloudflare Workers
yusukebe
1
290
Jakarta EE meets AI
ivargrimstad
0
150
CSC509 Lecture 12
javiergs
PRO
0
160
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
290
Realtime API 入門
riofujimon
0
150
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
170
as(型アサーション)を書く前にできること
marokanatani
10
2.6k
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
100
Featured
See All Featured
Unsuck your backbone
ammeep
668
57k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
89
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
The Language of Interfaces
destraynor
154
24k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
The Cult of Friendly URLs
andyhume
78
6k
GitHub's CSS Performance
jonrohan
1030
460k
Transcript
Chatterbot Support your development team
@Tomohiro twitter.com/ github.com/ coderwall.com/
@Tomohiro ࢲͩ
@gongoZ ͝Μ͝͞Μͩ
Recent... 1. Became mayer of Ruby in coderwall.com 2. Got
over 95 upvotes at protip in coderwall.com 3. AirPlayer in popularity (github, coderwall ...)
Recent... 1. Became mayer of Ruby in coderwall.com 2. Got
over 95 upvotes at protip in coderwall.com 3. AirPlayer in popularity (github, coderwall ...)
Recent... 1. Became mayer of Ruby in coderwall.com 2. Got
over 95 upvotes at protip in coderwall.com 3. AirPlayer in popularity (github, coderwall ...)
Recent... 1. Became mayer of Ruby in coderwall.com 2. Got
over 95 upvotes at protip in coderwall.com 3. AirPlayer in popularity (github, coderwall ...)
Recent... 1. Became mayer of Ruby in coderwall.com 2. Got
over 95 upvotes at protip in coderwall.com 3. AirPlayer in popularity (github, coderwall ...) current: 4th!!
Chatterbot a.k.a ਓޱແೳ
Chatterbot A chatter robot, chatterbot, chatbot, or chat bot is
a computer program designed to simulate an intelligent conversation with one or more human users via auditory or textual methods, primarily for engaging in small talk. - via Wikipedia chatterbot
ਓޱແೳ ਓແʢ͡Μ͜͏Ήͷ͏ʣͱɺਓೳʹରԠ ͢Δ༻ޠͰɺӳޠݍͰDIBUUFSCPUɺ͘͠ DIBUCPUͱݺΕɺͦͷ༁ޠͱͯ͠ձϘοτ͋ Δ͍͓͠ΌΓϘοτͱݺΕΔ͜ͱ͕͋Δɻ 8JLJQFEJBਓޱແೳΑΓ
ਓޱೳ ϘτϜΞοϓతͳਓೳͷΞϓϩʔνͰʮਓΒ͠ ͞ʯʹ౸ୡ͢Δ·ͰͷಓͷΓ͕ԕ͍ͷͰɺτοϓμϯ తʹʮਓΒ͠͞ʯͷϞσϧΛ࡞Γ͜Ή͜ͱͰʮਓΒ͠ ͞ʯΛ࡞Γग़ͦ͏ͱ͢Δཱɻ͓ΑͼͦͷཱͰ࡞ΒΕ ͨγεςϜɾϞσϧɾιϑτΣΞͳͲΛࢦ͢ɻ 8JLJQFEJBਓޱແೳΑΓ
Chatterbot on ... ɾChat system (IRC, Campfire, HipChat, and more...)
ɾWeb Service (Twitter, Yammer, and more...) ɾIM (Skype, Google IM, and more...)
Chatterbot on ... ɾChat system (IRC, Campfire, HipChat, and more...)
ɾWeb Service (Twitter, Yammer, and more...) ɾIM (Skype, Google IM, and more...)
Chatterbot on ... ɾChat system (IRC, Campfire, HipChat, and more...)
ɾWeb Service (Twitter, Yammer, and more...) ɾIM (Skype, Google IM, and more...)
Chatterbot on ... ɾChat system (IRC, Campfire, HipChat, and more...)
ɾWeb Service (Twitter, Yammer, and more...) ɾIM (Skype, Google IM, and more...)
Chatterbot softwares... ɾHubot (Node.js) ɾCinch (Ruby) ɾikachan (Perl)
Chatterbot softwares... ɾHubot (Node.js) ɾCinch (Ruby) ɾikachan (Perl)
Chatterbot softwares... ɾHubot (Node.js) ɾCinch (Ruby) ɾikachan (Perl)
Chatterbot softwares... ɾHubot (Node.js) ɾCinch (Ruby) ɾikachan (Perl)
Chatterbot softwares... ɾHubot (Node.js) ɾCinch (Ruby) ɾikachan (Perl) And many
more !!
νʔϜͷ
20125݄HubotΛ࠾༻
Hubot ࠾༻ͨ͠ཧ༝ ɾGitHub ɾ๛ͳϓϥάΠϯ ɾNode.js & CoffeeScript͕؆୯ͦ͏ ɾHerokuʹσϓϩΠͰ͖Δ
Hubot ࠾༻ͨ͠ཧ༝ ɾGitHub ɾ๛ͳϓϥάΠϯ ɾNode.js & CoffeeScript͕؆୯ͦ͏ ɾHerokuʹσϓϩΠͰ͖Δ
Hubot ࠾༻ͨ͠ཧ༝ ɾGitHub ɾ๛ͳϓϥάΠϯ ɾNode.js & CoffeeScript͕؆୯ͦ͏ ɾHerokuʹσϓϩΠͰ͖Δ
Hubot ࠾༻ͨ͠ཧ༝ ɾGitHub ɾ๛ͳϓϥάΠϯ ɾNode.js & CoffeeScript͕؆୯ͦ͏ ɾHerokuʹσϓϩΠͰ͖Δ
Hubot ࠾༻ͨ͠ཧ༝ ɾGitHub ɾ๛ͳϓϥάΠϯ ɾNode.js & CoffeeScript͕؆୯ͦ͏ ɾHerokuʹσϓϩΠͰ͖Δ
Hubot ΛࣾͰར༻ͯ͠Έͯ... ɾϓϩΩγڥԼͰ֎෦௨৴ग़དྷͳ͍ ɾϓϥάΠϯ࡞࣌ʹςετॻ͚ͳ͍ ɾHerokuʹσϓϩΠ͢Δબࢶ͕ͳ͍
Hubot ΛࣾͰར༻ͯ͠Έͯ... ɾϓϩΩγڥԼͰ֎෦௨৴ग़དྷͳ͍ ɾϓϥάΠϯ࡞࣌ʹςετॻ͚ͳ͍ ɾHerokuʹσϓϩΠ͢Δબࢶ͕ͳ͍
Hubot ΛࣾͰར༻ͯ͠Έͯ... ɾϓϩΩγڥԼͰ֎෦௨৴ग़དྷͳ͍ ɹˠ๛ͳϓϥάΠϯ͕͑ͳ͍ ɾϓϥάΠϯ࡞࣌ʹςετॻ͚ͳ͍ ɾHerokuʹσϓϩΠ͢Δબࢶ͕ͳ͍
Hubot ΛࣾͰར༻ͯ͠Έͯ... ɾϓϩΩγڥԼͰ֎෦௨৴ग़དྷͳ͍ ɹˠ๛ͳϓϥάΠϯ͕͑ͳ͍ ɾϓϥάΠϯ࡞࣌ʹςετॻ͚ͳ͍ ɾHerokuʹσϓϩΠ͢Δબࢶ͕ͳ͍
Hubot ΛࣾͰར༻ͯ͠Έͯ... ɾϓϩΩγڥԼͰ֎෦௨৴ग़དྷͳ͍ ɹˠ๛ͳϓϥάΠϯ͕͑ͳ͍ ɾϓϥάΠϯ࡞࣌ʹςετॻ͚ͳ͍ ɹˠ؆୯ʹϓϥάΠϯ͕ॻ͚ͳ͍ ɾHerokuʹσϓϩΠ͢Δબࢶ͕ͳ͍
Hubot ΛࣾͰར༻ͯ͠Έͯ... ɾϓϩΩγڥԼͰ֎෦௨৴ग़དྷͳ͍ ɹˠ๛ͳϓϥάΠϯ͕͑ͳ͍ ɾϓϥάΠϯ࡞࣌ʹςετॻ͚ͳ͍ ɹˠ؆୯ʹϓϥάΠϯ͕ॻ͚ͳ͍ ɾHerokuʹσϓϩΠ͢Δબࢶ͕ͳ͍
Hubot ΛࣾͰར༻ͯ͠Έͯ... ɾϓϩΩγڥԼͰ֎෦௨৴ग़དྷͳ͍ ɹˠ๛ͳϓϥάΠϯ͕͑ͳ͍ ɾϓϥάΠϯ࡞࣌ʹςετॻ͚ͳ͍ ɹˠ؆୯ʹϓϥάΠϯ͕ॻ͚ͳ͍ ɾHerokuʹσϓϩΠ͢Δબࢶ͕ͳ͍ ɹˠࣾωοτϫʔΫʹͭͳ͍͛ͨ
νʔϜʹඞཁͳͷ... ɾIRCαʔόʹଓͯ͠ಈ࡞͢Δ ɾϓϩΩγڥԼͰಈ࡞ ɾϓϥάΠϯͰػೳΛ૿ͤΔ ɾϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ɾΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ɾԠػೳͱఆظൃݴػೳΛ࣋ͭ
νʔϜʹඞཁͳͷ... ɾIRCαʔόʹଓͯ͠ಈ࡞͢Δ ɾϓϩΩγڥԼͰಈ࡞ ɾϓϥάΠϯͰػೳΛ૿ͤΔ ɾϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ɾΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ɾԠػೳͱఆظൃݴػೳΛ࣋ͭ
νʔϜʹඞཁͳͷ... ɾIRCαʔόʹଓͯ͠ಈ࡞͢Δ ɾϓϩΩγڥԼͰಈ࡞ ɾϓϥάΠϯͰػೳΛ૿ͤΔ ɾϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ɾΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ɾԠػೳͱఆظൃݴػೳΛ࣋ͭ
νʔϜʹඞཁͳͷ... ɾIRCαʔόʹଓͯ͠ಈ࡞͢Δ ɾϓϩΩγڥԼͰಈ࡞ ɾϓϥάΠϯͰػೳΛ૿ͤΔ ɾϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ɾΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ɾԠػೳͱఆظൃݴػೳΛ࣋ͭ
νʔϜʹඞཁͳͷ... ɾIRCαʔόʹଓͯ͠ಈ࡞͢Δ ɾϓϩΩγڥԼͰಈ࡞ ɾϓϥάΠϯͰػೳΛ૿ͤΔ ɾϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ɾΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ɾԠػೳͱఆظൃݴػೳΛ࣋ͭ
νʔϜʹඞཁͳͷ... ɾIRCαʔόʹଓͯ͠ಈ࡞͢Δ ɾϓϩΩγڥԼͰಈ࡞ ɾϓϥάΠϯͰػೳΛ૿ͤΔ ɾϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ɾΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ɾԠػೳͱఆظൃݴػೳΛ࣋ͭ
νʔϜʹඞཁͳͷ... ɾIRCαʔόʹଓͯ͠ಈ࡞͢Δ ɾϓϩΩγڥԼͰಈ࡞ ɾϓϥάΠϯͰػೳΛ૿ͤΔ ɾϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ɾΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ɾԠػೳͱఆظൃݴػೳΛ࣋ͭ
νʔϜʹඞཁͳͷ... ɾIRCαʔόʹଓͯ͠ಈ࡞͢Δ ɾϓϩΩγڥԼͰಈ࡞ ɾϓϥάΠϯͰػೳΛ૿ͤΔ ɾϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ɾΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ɾԠػೳͱఆظൃݴػೳΛ࣋ͭ
νʔϜʹඞཁͳͷ... ɾIRCαʔόʹଓͯ͠ಈ࡞͢Δ ɾϓϩΩγڥԼͰಈ࡞ ɾϓϥάΠϯͰػೳΛ૿ͤΔ ɾϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ɾΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ɾԠػೳͱఆظൃݴػೳΛ࣋ͭ 3VCZͰ ɹɹॻ͚ͦ͏ʂ
࡞Γ·ͨ͠ ઌि
Kris Pluggable, and very simple. https://github.com/Tomohiro/kris depend on ‘zircon’. Thanks
to @r7kamura
ࠓग़དྷΔ͜ͱ ✓ϓϩΩγڥԼͰಈ࡞ ✓ϓϥάΠϯͰػೳΛ૿ͤΔ ✗ϓϥάΠϯΛॻ࣌͘ʹ୯ମςετॻ͚Δ ✓ΦʔϓϯιʔεϥΠϒϥϦۃྗར༻͍ͨ͠ ✓ԠػೳͱఆظൃݴػೳΛ࣋ͭ
kris example project /mybot/ |-- Gemfile ґଘؔΛॻ͘ |-- bot Bot
ىಈϓϩάϥϜ `-- plugin ϓϥάΠϯ༻σΟϨΫτϦ |-- foo.rb `-- bar.rb
Bootstrap #!/usr/bin/env ruby require ‘kris’ Kris::Session.new( :server => ‘chat.freenode.net’, :port
=> 6667, :channel => ‘#MyChannel’, :username => ‘KrisBot’ ).start
Plugin example # Hello ͱ͍͏ൃݴʹ Hello! ͱฦ͢Δྫ class Reply <
Kris::Plugin def response(message) if message.body =~ /^Hello/ notice(message.to, ‘Hello!’) end end end
Plugin example # 1͝ͱʹݱࡏ࣌ࠁΛͭͿ͘ class Timer < Kris::Plugin def notify
notice(@robot.channel, Time.now.to_s) sleep 60 end end
TODO ɾϥΠϒϥϦͷςετॻ͘ ɾϓϥάΠϯͷςετख๏Λཱ֬ ɾRubyGems.orgʹϦϦʔε͢Δ
͓·͚ - Heroku Ͱಈ͘Αฤ $ cd my-bot $ echo ‘bot:
bundle exec ruby bot’ > Procfile $ heroku create {my-bot-name} $ git commit -a -m ‘my bot on heroku’ $ git push heroku master $ heroku ps:scale bot=1
Any Questions?