wit_bot 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 549a0b5878b37d6cad5a60ce08cf73d24e6c00f5
4
- data.tar.gz: f0a17fab1335c1df10d6f1613bf82ae8e423e29b
3
+ metadata.gz: dde5c0de0ce7e5d4de9658ffcb1ba92aefaf4419
4
+ data.tar.gz: 715db22fdc8c0abb2856cd76b0f8f5627f2aef1f
5
5
  SHA512:
6
- metadata.gz: 98de64370554a72a83b26f0600512c2e80e165885b61a5238da82b7406bc0be094ed3284d597d0043cb9570eb4a1e9b02f46c44ce09abfe9e257cdd90e26388c
7
- data.tar.gz: f18fddda7d520c9999b5236e1c896a8a7fb3a90b9c05d6f17ffb44840bb77dfca8df39fc5c56d9863cad30e232c9b6e1f11209204845e82900ecb1c7e0f322b9
6
+ metadata.gz: e57891cac4c7039e3565716c04520b35700149052f33cffca88d3885a079f611330afaa28a905cb7ec68ccb5e37cb41f68b162ccdd73604ba179590acd253346
7
+ data.tar.gz: bc7c18659f0c434b9781db739f7be755f824b09b8ca9068e0aea8edc7fdeb8fa6dd9e19b175d7745bb62c213054f2f999aba9739075478e2eb21bf73c95d5731
@@ -8,8 +8,6 @@ WitBot.configure do |c|
8
8
  c.token = ENV['WIT_ACCESS_TOKEN'] # Create a wit bot and set the token here
9
9
  end
10
10
 
11
- WitBot.config
12
-
13
11
  conversation = WitBot::Bot::Conversation::Base.new
14
12
 
15
13
  bot = Bot.new conversation
@@ -18,10 +18,10 @@ class Bot < WitBot::Bot::Base
18
18
 
19
19
  def login(outcome)
20
20
  if (pin_code = outcome.entities[:pin_code])
21
- output "Logged you in with the pin code: #{pin_code}"
21
+ send_message "Logged you in with the pin code: #{pin_code}"
22
22
  else
23
23
  conversation.thread.context.state << :missing_pin
24
- output 'Please include a pin code.'
24
+ send_message 'Please include a pin code.'
25
25
  end
26
26
  end
27
27
 
@@ -33,6 +33,6 @@ class Bot < WitBot::Bot::Base
33
33
 
34
34
  msg = "Yup, that #{thing || 'thing'} is #{adjective || 'a word'}."
35
35
 
36
- output msg
36
+ send_message msg
37
37
  end
38
38
  end
@@ -8,12 +8,18 @@ module WitBot
8
8
  @conversation = conversation
9
9
  @conversation.add_observer self
10
10
  end
11
+
11
12
  def bot?
12
13
  true
13
14
  end
14
- def output(text)
15
+
16
+ def send_message(text)
15
17
  @conversation.send_message text, self
16
18
  end
19
+
20
+ # Alias is deprecated.
21
+ alias :output :send_message
22
+
17
23
  def update(type, message)
18
24
  case type
19
25
  when :input
@@ -1,3 +1,3 @@
1
1
  module WitBot
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wit_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben (@penne12_)