wit_bot 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/examples/bot.rb +0 -2
- data/examples/bot/bot.rb +3 -3
- data/lib/wit_bot/bot/conversation/participant.rb +7 -1
- data/lib/wit_bot/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dde5c0de0ce7e5d4de9658ffcb1ba92aefaf4419
|
4
|
+
data.tar.gz: 715db22fdc8c0abb2856cd76b0f8f5627f2aef1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e57891cac4c7039e3565716c04520b35700149052f33cffca88d3885a079f611330afaa28a905cb7ec68ccb5e37cb41f68b162ccdd73604ba179590acd253346
|
7
|
+
data.tar.gz: bc7c18659f0c434b9781db739f7be755f824b09b8ca9068e0aea8edc7fdeb8fa6dd9e19b175d7745bb62c213054f2f999aba9739075478e2eb21bf73c95d5731
|
data/examples/bot.rb
CHANGED
data/examples/bot/bot.rb
CHANGED
@@ -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
|
-
|
21
|
+
send_message "Logged you in with the pin code: #{pin_code}"
|
22
22
|
else
|
23
23
|
conversation.thread.context.state << :missing_pin
|
24
|
-
|
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
|
-
|
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
|
-
|
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
|
data/lib/wit_bot/version.rb
CHANGED