messenger_client 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/messenger_client/message/base.rb +3 -2
- data/lib/messenger_client/message/image.rb +1 -1
- data/lib/messenger_client/message/sticker.rb +19 -0
- data/lib/messenger_client/message.rb +1 -0
- data/lib/messenger_client/message_parser.rb +5 -1
- data/lib/messenger_client/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 524b8fdd5ffac1533800a6a5737614955ee99cbb
|
4
|
+
data.tar.gz: 3422f84c7585c921c58bc876e8acfc038477b0f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48caaea31af3ef54007c7a5aa561b79c3bf44aadd7d8866cfb73cdded4e0fd8ca6449f3ad4a2ddb3f16cee391fc4318343d51a5c298c94ffd4f7ffaff9932ad1
|
7
|
+
data.tar.gz: fe6fde59c460a050bc1f214958c6cc8f8ae5cec4f8baa8d3c3f4accf2e9c74f2259c3a3560aaa0660c4b52d39b881b17e6b7825028039da90f79420fc74b52d9
|
@@ -1,8 +1,9 @@
|
|
1
1
|
module MessengerClient
|
2
2
|
module Message
|
3
3
|
class Base < Struct
|
4
|
-
def postback;
|
5
|
-
def text;
|
4
|
+
def postback; respond_to?(:_postback) ? _postback : nil; end
|
5
|
+
def text; respond_to?(:_text) ? _text : nil; end
|
6
|
+
def thumbs_up?; false end
|
6
7
|
end
|
7
8
|
end
|
8
9
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module MessengerClient
|
2
|
+
module Message
|
3
|
+
Sticker = Base.new(:id, :timestamp, :sender, :url, :sticker_id) do
|
4
|
+
THUMBS = {
|
5
|
+
"369239263222822" => :small,
|
6
|
+
"369239343222814" => :medium,
|
7
|
+
"369239383222810" => :large,
|
8
|
+
}
|
9
|
+
|
10
|
+
def thumbs_up?
|
11
|
+
!!thumb_size
|
12
|
+
end
|
13
|
+
|
14
|
+
def thumb_size
|
15
|
+
THUMBS[sticker_id.to_s]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -6,5 +6,6 @@ require "messenger_client/message/location"
|
|
6
6
|
require "messenger_client/message/postback"
|
7
7
|
require "messenger_client/message/quick_reply"
|
8
8
|
require "messenger_client/message/sender"
|
9
|
+
require "messenger_client/message/sticker"
|
9
10
|
require "messenger_client/message/text"
|
10
11
|
require "messenger_client/message/video"
|
@@ -27,7 +27,11 @@ module MessengerClient
|
|
27
27
|
url = pl["url"]
|
28
28
|
case attch["type"]
|
29
29
|
when "image"
|
30
|
-
|
30
|
+
if sid = pl["sticker_id"]
|
31
|
+
MessengerClient::Message::Sticker.new(m["mid"], timestamp, sender, url, sid)
|
32
|
+
else
|
33
|
+
MessengerClient::Message::Image.new(m["mid"], timestamp, sender, url)
|
34
|
+
end
|
31
35
|
when "video"
|
32
36
|
MessengerClient::Message::Video.new(m["mid"], timestamp, sender, url)
|
33
37
|
when "audio"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: messenger_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Cruz
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- lib/messenger_client/message/postback.rb
|
106
106
|
- lib/messenger_client/message/quick_reply.rb
|
107
107
|
- lib/messenger_client/message/sender.rb
|
108
|
+
- lib/messenger_client/message/sticker.rb
|
108
109
|
- lib/messenger_client/message/text.rb
|
109
110
|
- lib/messenger_client/message/video.rb
|
110
111
|
- lib/messenger_client/message_parser.rb
|