lita-talk 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/handlers/talk.rb +5 -1
- data/lita-talk.gemspec +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: f6ce1aff92356db9df8a3e6fb54cc42c8a6f86f0
|
4
|
+
data.tar.gz: 6c7c8321c39a6ecf5c0cf6a4fb0bb8c1c7aaeb06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29187f95a63d2a05930cb3b8ec96ff09c7a94ebbe2d7087756856ddc4fa780d5ad1c27de6460b0fcf238c040a7a74aea06bfbb3d6453ebc6ecf36773dff5fe58
|
7
|
+
data.tar.gz: 27c78ae68a8165e842a7b639750aa8a14be4ab5c6a68cc3f1078a764bbb122f5f3346bb5d5a553a8494b8803aa42702eb2d1b74acb3e4aa4a686af027e47019e
|
data/lib/lita/handlers/talk.rb
CHANGED
@@ -19,9 +19,13 @@ module Lita
|
|
19
19
|
return if response.matches.flatten[0].match(route.pattern)
|
20
20
|
end
|
21
21
|
|
22
|
+
if response.matches.flatten[0].match(/ところで|それはそうと|そういえば|BTW/)
|
23
|
+
Lita.redis.del context_key(response)
|
24
|
+
end
|
25
|
+
|
22
26
|
context = Lita.redis.get context_key(response)
|
23
27
|
api_response = client.create_dialogue(response.message.body, params(context))
|
24
|
-
Lita.redis.
|
28
|
+
Lita.redis.setex context_key(response), 600, api_response.body["context"]
|
25
29
|
response.reply api_response.body["utt"]
|
26
30
|
end
|
27
31
|
|
data/lita-talk.gemspec
CHANGED