bot 0.0.37 → 0.0.38
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bot/responder.rb +21 -0
- data/lib/bot/version.rb +1 -1
- data/test/dummy/log/test.log +43 -0
- 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: 8aadd7727dd46fa03fdf37373bf78c7f4768d5d4
|
4
|
+
data.tar.gz: 27a64c56e216f3bac1df35dfc1b85632370231c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5757f2947ffa5d272a593e9b6a06c066a7a33667e2d2b67a86a3328c30d8d0bead3868f4f71cec5ddcdece6cc5c566b22a2e3966c35d2952d09ec4391eb46c1
|
7
|
+
data.tar.gz: 55cee88000f96f1286d8ed617affd0a552c35fa3e1510437dcc70c071a77f382ee58081845446cdaaa74aaee9e21564e6ee2ba701bb4d72546e1e78bafe0edb0
|
data/lib/bot/responder.rb
CHANGED
@@ -68,6 +68,27 @@ module Bot
|
|
68
68
|
photo_response
|
69
69
|
end
|
70
70
|
|
71
|
+
def card_response(text, url, icon=nil)
|
72
|
+
card = {
|
73
|
+
'type' => 'link',
|
74
|
+
'to' => message['from'],
|
75
|
+
'url' => url,
|
76
|
+
'title' => "", # Displays over the image
|
77
|
+
'text' => text, # Displays under the image
|
78
|
+
'attribution' => {
|
79
|
+
'name' => text # Displays in bottom line
|
80
|
+
},
|
81
|
+
'chatId' => message['chatId']
|
82
|
+
}
|
83
|
+
|
84
|
+
card['picUrl'] = icon if icon
|
85
|
+
card['attribution']['iconUrl'] = icon if icon
|
86
|
+
|
87
|
+
[
|
88
|
+
card
|
89
|
+
]
|
90
|
+
end
|
91
|
+
|
71
92
|
def video_response(video_id, suggested_responses=false)
|
72
93
|
video_response = {
|
73
94
|
'type' => 'video',
|
data/lib/bot/version.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -3334,5 +3334,48 @@ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
|
3334
3334
|
Started POST "/bot/notify" for 127.0.0.1 at 2016-05-02 10:47:44 -0400
|
3335
3335
|
Processing by Bot::BotController#notify as HTML
|
3336
3336
|
Parameters: {"messages"=>[{"body"=>"Hello", "readReceiptRequested"=>"true", "from"=>"bnmrrs", "timestamp"=>"1452785908454", "type"=>"text", "id"=>"2af0d873-d157-4627-b863-8be11b0dfd86"}], "bot"=>ApplicationHandler}
|
3337
|
+
Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
3338
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3339
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.4ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3340
|
+
[1m[36m (1.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
3341
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
3342
|
+
[1m[36m (0.8ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
3343
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
3344
|
+
[1m[36m (0.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
3345
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
3346
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3347
|
+
-------------------
|
3348
|
+
BotTest: test_truth
|
3349
|
+
-------------------
|
3350
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3351
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3352
|
+
---------------------------
|
3353
|
+
NavigationTest: test_notify
|
3354
|
+
---------------------------
|
3355
|
+
Started POST "/bot/notify" for 127.0.0.1 at 2016-05-02 17:23:53 -0400
|
3356
|
+
Processing by Bot::BotController#notify as HTML
|
3357
|
+
Parameters: {"bot"=>ApplicationHandler}
|
3358
|
+
Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)
|
3359
|
+
Started POST "/bot/notify" for 127.0.0.1 at 2016-05-02 17:23:53 -0400
|
3360
|
+
Processing by Bot::BotController#notify as HTML
|
3361
|
+
Parameters: {"messages"=>[{"body"=>"Hello", "readReceiptRequested"=>"true", "from"=>"bnmrrs", "timestamp"=>"1452785908454", "type"=>"text", "id"=>"2af0d873-d157-4627-b863-8be11b0dfd86"}], "bot"=>ApplicationHandler}
|
3362
|
+
Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
3363
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3364
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3365
|
+
-----------------------------------------
|
3366
|
+
NavigationTest: test_notify_special_types
|
3367
|
+
-----------------------------------------
|
3368
|
+
Started POST "/bot/notify" for 127.0.0.1 at 2016-05-02 17:23:53 -0400
|
3369
|
+
Processing by Bot::BotController#notify as HTML
|
3370
|
+
Parameters: {"messages"=>[{"body"=>"Hello", "readReceiptRequested"=>"true", "from"=>"bnmrrs", "timestamp"=>"1452785908454", "type"=>"scan-data", "id"=>"2af0d873-d157-4627-b863-8be11b0dfd86"}], "bot"=>ApplicationHandler}
|
3371
|
+
Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
3372
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3373
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3374
|
+
---------------------------------------
|
3375
|
+
NavigationTest: test_notify_multi_types
|
3376
|
+
---------------------------------------
|
3377
|
+
Started POST "/bot/notify" for 127.0.0.1 at 2016-05-02 17:23:53 -0400
|
3378
|
+
Processing by Bot::BotController#notify as HTML
|
3379
|
+
Parameters: {"messages"=>[{"body"=>"multi", "readReceiptRequested"=>"true", "from"=>"bnmrrs", "timestamp"=>"1452785908454", "type"=>"scan-data", "id"=>"2af0d873-d157-4627-b863-8be11b0dfd86"}], "bot"=>ApplicationHandler}
|
3337
3380
|
Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
3338
3381
|
[1m[35m (0.1ms)[0m rollback transaction
|