kanal-interfaces-telegram 0.3.4 → 0.3.6

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
  SHA256:
3
- metadata.gz: eb17cbf2b3631ab8320f5be818f93e1de7cd197bc6efd446938c885cb3648e26
4
- data.tar.gz: 80993d4ea89a7987751fb60cb60d15362822ce0d047f4536856a929dbbb16d92
3
+ metadata.gz: f19e50bebf40730909f021233864991167a27bb84a996dd482a926df91d80967
4
+ data.tar.gz: c35d87cbaadf9c94f5e86dd38dcd4c10a282d3401b8329269a5d1d1454291dc6
5
5
  SHA512:
6
- metadata.gz: 5ac899cf16df2d4a47c52f118d0a8975e4a26dae0b669d6d4cfcfddfdf6a9a00a91c19a705c4d6f40a0263f595e0d9f3125d0e5b8972b3e3845fab17efa3d429
7
- data.tar.gz: a14091415a77854056df9dfe31ad313856de79d8b424798eb9b36212e16836414e804df709f3df31e80bf67267c7bcea8ff9a46cdd7ebbbc95f3dade95f35ddf
6
+ metadata.gz: b28bcfb7a561f59c187fe00ccffccff1ad5221fbd333c02ef3708bbde7acff911050194657c11eb6226dd6c73f923cb632856ffd6103785dcd3bff50a41d3093
7
+ data.tar.gz: 6366da43dff1958556fdcc52fe832eb8f0b8c942569f00720c4c0aca4e03d8eaed840e45133c2d6295efc8f25d1dcd616d04087f7f7cae29bf6c0c316b7277f8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kanal-interfaces-telegram (0.3.4)
4
+ kanal-interfaces-telegram (0.3.6)
5
5
  kanal (= 0.4.3)
6
6
  telegram-bot-ruby (= 1.0.0)
7
7
 
@@ -128,6 +128,7 @@ GEM
128
128
 
129
129
  PLATFORMS
130
130
  x86_64-darwin-21
131
+ x86_64-darwin-22
131
132
  x86_64-linux
132
133
 
133
134
  DEPENDENCIES
@@ -141,4 +142,4 @@ DEPENDENCIES
141
142
  yard
142
143
 
143
144
  BUNDLED WITH
144
- 2.4.5
145
+ 2.4.9
@@ -40,12 +40,20 @@ module Kanal
40
40
  def create_input(message)
41
41
  input = @core.create_input
42
42
 
43
- if !message.instance_variable_defined?(:@data)
43
+ if message.attributes.key?(:data)
44
+ # Inline button pressed
45
+ input.tg_button_pressed = message.data
46
+ input.tg_chat_id = message.from.id
47
+ input.tg_username = message.from.username
48
+ else
44
49
  # Regular message received
45
- input.tg_text = message.text
46
50
  input.tg_chat_id = message.chat.id
47
51
  input.tg_username = message.chat.username || message.from.username
48
52
 
53
+ if !message.text.nil?
54
+ input.tg_text = message.text
55
+ end
56
+
49
57
  if !message.photo.nil?
50
58
  # Array of images contains thumbnails, we take 3rd element to get the high-res image
51
59
  input.tg_image_link = @link_parser.get_file_link message.photo.last.file_id, @bot, @bot_token
@@ -62,11 +70,6 @@ module Kanal
62
70
  if !message.document.nil?
63
71
  input.tg_document_link = @link_parser.get_file_link message.document.file_id, @bot, @bot_token
64
72
  end
65
- else
66
- # Inline button pressed
67
- input.tg_button_pressed = message.data
68
- input.tg_chat_id = message.from.id
69
- input.tg_username = message.from.username
70
73
  end
71
74
 
72
75
  input
@@ -3,7 +3,7 @@
3
3
  module Kanal
4
4
  module Interfaces
5
5
  module Telegram
6
- VERSION = "0.3.4"
6
+ VERSION = "0.3.6"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kanal-interfaces-telegram
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - idchlife
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-03 00:00:00.000000000 Z
11
+ date: 2023-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kanal