kanal-interfaces-telegram 0.3.5 → 0.4.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17ccff6437a91f54aa255776635f673e5cc543b0eeac33e1ee340dee7f004052
|
4
|
+
data.tar.gz: 2b6d5fd4893836911e76ffd220bddba14ad6db08d7d8b86e9e67b6569cb63808
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77607693b57b092146e2ad8225400505f4e9593bcf3b4dbe4027a3aaad7083b858e0b40804c23db2fcf2771c3de615b13834a7fbd647a230b5ed9fcebcd25d55
|
7
|
+
data.tar.gz: cc3f8877a7f0c751d3de34ef6b468854488efef0d282f44008fa4adad4657ba6f9ec8cae079ec30585d5bb779f21a656ecffd15c964e474a4efa7db6400d838b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.4.0] - 2023-04-13
|
4
|
+
- If output.tg_chat_id provided - interface does not replace it with input.tg_chat_id (useful when creating additional responses with different chat_ids)
|
5
|
+
|
3
6
|
## [0.3.1] - 2023-03-31
|
4
7
|
- Fixed parsing link for file attachments. Now file attachments parsing works
|
5
8
|
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
kanal-interfaces-telegram (0.
|
4
|
+
kanal-interfaces-telegram (0.4.0)
|
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.
|
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.attributes.key?(:
|
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
|
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.
|
4
|
+
version: 0.4.0
|
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-
|
11
|
+
date: 2023-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kanal
|