kanal-interfaces-telegram 0.3.0 → 0.3.2

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: d561c375f8a3d3802d78a2c03b7b8859d4d6db10cd6a4fb55242dc11776c2448
4
- data.tar.gz: 1fe7521d6848968a584173484fbdeca37ebbf1d9cebc0ffa07cff2d8ceab6298
3
+ metadata.gz: abdb7f4e0f246130a0e292dfe8c8c848152361d058e433601ae964f8d7f819d1
4
+ data.tar.gz: e12507cdc515f58778551d48ccdf6d6b8146eaee268aa12a89e440347cd7642e
5
5
  SHA512:
6
- metadata.gz: 93dec85818dcf56c4d578a4ad82564bfd4dde43e101d04bea1c7f32095aab0c9ca89db0e725829c2482fc179b1bceee3d6391bbda1ac5cd9f4c83dc6b1ddb641
7
- data.tar.gz: 29e6de8af8c702984d6829f74c7ddd3393b315aade1b31a1c64f4000d0564f2528022ae5ebd4d77e952a18e009aa83c77a215735c355b9308fb4b993638ef072
6
+ metadata.gz: 9bb89e6e8c8f076e46aa04230ee922a40dfd8dce8bb6be6ff44e016224803b3d6901ac897a06e67b8a1d8e267c153d294d3c61c738a41faea332a1075e2aef95
7
+ data.tar.gz: 8f5022c666ab19fd863db659c727de16251fd1dbdebb0f5de2b1d7d73d419e5567acefde0905e8ac84a2598703c9478ed5a0e38aad51df02c86d64ddd4b0a2ba
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.3.1] - 2023-03-31
4
+ - Fixed parsing link for file attachments. Now file attachments parsing works
5
+
3
6
  ## [0.3.0] - 2023-03-10
4
7
  - Reworked interface with the new Kanal release, now it uses Interface base class properly
5
8
 
data/Gemfile CHANGED
@@ -9,7 +9,9 @@ gem "rake", "~> 13.0"
9
9
 
10
10
  gem "rspec", "~> 3.0"
11
11
 
12
- gem "kanal", "0.4.0"
12
+ gem "kanal", "0.4.3"
13
+
14
+ gem "telegram-bot-ruby", "1.0.0"
13
15
 
14
16
  group :development do
15
17
  gem "rubocop", "~> 1.21"
data/Gemfile.lock CHANGED
@@ -1,26 +1,36 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kanal-interfaces-telegram (0.2.1)
5
- telegram-bot-ruby
4
+ kanal-interfaces-telegram (0.3.2)
6
5
 
7
6
  GEM
8
7
  remote: https://rubygems.org/
9
8
  specs:
10
9
  ast (2.4.2)
11
- axiom-types (0.1.1)
12
- descendants_tracker (~> 0.0.4)
13
- ice_nine (~> 0.11.0)
14
- thread_safe (~> 0.3, >= 0.3.1)
15
10
  backport (1.2.0)
16
11
  benchmark (0.2.1)
17
- coercible (1.0.0)
18
- descendants_tracker (~> 0.0.1)
19
- descendants_tracker (0.0.4)
20
- thread_safe (~> 0.3, >= 0.3.1)
12
+ concurrent-ruby (1.2.2)
21
13
  diff-lcs (1.5.0)
22
14
  docile (1.4.0)
15
+ dry-core (1.0.0)
16
+ concurrent-ruby (~> 1.0)
17
+ zeitwerk (~> 2.6)
23
18
  dry-inflector (1.0.0)
19
+ dry-logic (1.5.0)
20
+ concurrent-ruby (~> 1.0)
21
+ dry-core (~> 1.0, < 2)
22
+ zeitwerk (~> 2.6)
23
+ dry-struct (1.6.0)
24
+ dry-core (~> 1.0, < 2)
25
+ dry-types (>= 1.7, < 2)
26
+ ice_nine (~> 0.11)
27
+ zeitwerk (~> 2.6)
28
+ dry-types (1.7.1)
29
+ concurrent-ruby (~> 1.0)
30
+ dry-core (~> 1.0)
31
+ dry-inflector (~> 1.0)
32
+ dry-logic (~> 1.4)
33
+ zeitwerk (~> 2.6)
24
34
  e2mmap (0.1.0)
25
35
  faraday (2.7.4)
26
36
  faraday-net_http (>= 2.0, < 3.1)
@@ -31,7 +41,7 @@ GEM
31
41
  ice_nine (0.11.2)
32
42
  jaro_winkler (1.5.4)
33
43
  json (2.6.3)
34
- kanal (0.4.0)
44
+ kanal (0.4.3)
35
45
  kramdown (2.4.0)
36
46
  rexml
37
47
  kramdown-parser-gfm (1.1.0)
@@ -101,29 +111,25 @@ GEM
101
111
  thor (~> 1.0)
102
112
  tilt (~> 2.0)
103
113
  yard (~> 0.9, >= 0.9.24)
104
- telegram-bot-ruby (0.23.0)
105
- dry-inflector
114
+ telegram-bot-ruby (1.0.0)
115
+ dry-struct (~> 1.6)
106
116
  faraday (~> 2.0)
107
117
  faraday-multipart (~> 1.0)
108
- virtus (~> 2.0)
118
+ zeitwerk (~> 2.6)
109
119
  thor (1.2.1)
110
- thread_safe (0.3.6)
111
120
  tilt (2.0.11)
112
121
  unicode-display_width (2.4.2)
113
- virtus (2.0.0)
114
- axiom-types (~> 0.1)
115
- coercible (~> 1.0)
116
- descendants_tracker (~> 0.0, >= 0.0.3)
117
122
  webrick (1.7.0)
118
123
  yard (0.9.28)
119
124
  webrick (~> 1.7.0)
125
+ zeitwerk (2.6.7)
120
126
 
121
127
  PLATFORMS
122
128
  x86_64-darwin-21
123
129
  x86_64-linux
124
130
 
125
131
  DEPENDENCIES
126
- kanal (= 0.4.0)
132
+ kanal (= 0.4.3)
127
133
  kanal-interfaces-telegram!
128
134
  rake (~> 13.0)
129
135
  rspec (~> 3.0)
@@ -131,6 +137,7 @@ DEPENDENCIES
131
137
  ruby-debug-ide
132
138
  simplecov
133
139
  solargraph
140
+ telegram-bot-ruby (= 1.0.0)
134
141
  yard
135
142
 
136
143
  BUNDLED WITH
data/README.md CHANGED
@@ -1,8 +1,14 @@
1
1
  # Kanal::Interfaces::Telegram
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/kanal/interfaces/telegram`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Welcome to Telegram interface!
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ Integrate this interface into your Kanal app workflow and it will handle the incoming messages containing plain text or media (images, audio, videos, documents). You can attach media to your responses as well.
6
+
7
+ This interface relies on telegram-bot-ruby wrapper (https://github.com/atipugin/telegram-bot-ruby) to handle the actual communication with Telegram API.
8
+
9
+ Upon receiving a message or callback from end-user through telegram-bot-ruby, Telegram interface will transform incoming data into Kanal input with specific Telegram properties and feed it to router. Router will form an output (or outputs), which will be sent to Telegram interface. Telegram interface will send a message (or messages) through telegram-bot-ruby wrapper to end-user.
10
+
11
+ It is advised to use Telegram interface with Telegram bridge which converts specific input/output properties to standard Kanal properties.
6
12
 
7
13
  ## Installation
8
14
 
@@ -16,7 +22,48 @@ If bundler is not being used to manage dependencies, install the gem by executin
16
22
 
17
23
  ## Usage
18
24
 
19
- TODO: Write usage instructions here
25
+ 1. Create instance of Core:
26
+
27
+ ```core = Kanal::Core::Core.new```
28
+
29
+ 2. Create instance of Telegram interface
30
+
31
+ ```interface = Kanal::Interfaces::Telegram::TelegramInterface.new core, "YOUR_TOKEN"```
32
+
33
+ 3. You can use https://github.com/idchlife/kanal-plugins-batteries_bridge to convert Telegram interface specific properties to Kanal Batteries plugin properties. Batteries plugin properties are using generally known keywords such as :body, :image, :audio etc. More info you can get inside batteries bridge plugin repository
34
+
35
+ ```core.register_plugin Kanal::Plugins::Batteries::BatteriesPlugin.new```
36
+
37
+ 4. Add your condition packs (or use conditions provided by Batteries plugin)
38
+
39
+ ```
40
+ # Conditions need to be coded for usage in routing
41
+ core.add_condition_pack :tg_text do
42
+ add_condition :is do
43
+ with_argument
44
+ met? do |input, _core, argument| # 3 arguments provided to the block
45
+ input.tg_text == argument
46
+ end
47
+ end
48
+ end
49
+
50
+ core.router.configure do
51
+ # Response for condition created above
52
+ on :tg_text, is: "foo" do
53
+ respond do
54
+ tg_text "bar"
55
+ end
56
+ end
57
+ end
58
+
59
+ core.router.default_response do
60
+ tg_text "Default response"
61
+ end
62
+ ```
63
+
64
+ 5. Start your bot
65
+
66
+ ```interface.start```
20
67
 
21
68
  ## Development
22
69
 
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "kanal/core/core"
4
+ require "kanal/interfaces/telegram/telegram_interface"
5
+
6
+ core = Kanal::Core::Core.new
7
+
8
+ interface = Kanal::Interfaces::Telegram::TelegramInterface.new core, "replace-me-with-your-token"
9
+
10
+ core.add_condition_pack :tg_text do
11
+ add_condition :is do
12
+ with_argument
13
+ met? do |input, _core, argument|
14
+ input.tg_text == argument
15
+ end
16
+ end
17
+ end
18
+
19
+ core.router.configure do
20
+ on :tg_text, is: "foo" do
21
+ respond do
22
+ tg_text "bar"
23
+ end
24
+ end
25
+ end
26
+
27
+ core.router.default_response do
28
+ tg_text "Default response"
29
+ end
30
+
31
+ interface.start
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Kanal
4
+ module Interfaces
5
+ module Telegram
6
+ module Helpers
7
+ class TelegramLinkParser
8
+ def get_file_link(file_id, bot, bot_token)
9
+ file = bot.api.get_file(file_id: file_id)
10
+ file_path = file.dig('result', 'file_path')
11
+ "https://api.telegram.org/file/bot#{bot_token}/#{file_path}"
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -16,21 +16,22 @@ module Kanal
16
16
  end
17
17
 
18
18
  def register_parameters(core)
19
- core.register_input_parameter :tg_message, readonly: true
20
- core.register_input_parameter :tg_text, readonly: true
21
- core.register_input_parameter :tg_callback, readonly: true
22
- core.register_input_parameter :tg_callback_text, readonly: true
23
19
  core.register_input_parameter :tg_chat_id, readonly: true
24
20
  core.register_input_parameter :tg_username, readonly: true
21
+ core.register_input_parameter :tg_text, readonly: true
22
+ core.register_input_parameter :tg_button_pressed, readonly: true
25
23
  core.register_input_parameter :tg_image_link, readonly: true
26
24
  core.register_input_parameter :tg_audio_link, readonly: true
25
+ core.register_input_parameter :tg_video_link, readonly: true
26
+ core.register_input_parameter :tg_document_link, readonly: true
27
27
 
28
28
  core.register_output_parameter :tg_chat_id
29
29
  core.register_output_parameter :tg_text
30
- core.register_output_parameter :tg_reply_markup
31
30
  core.register_output_parameter :tg_image_path
32
31
  core.register_output_parameter :tg_audio_path
32
+ core.register_output_parameter :tg_video_path
33
33
  core.register_output_parameter :tg_document_path
34
+ core.register_output_parameter :tg_reply_markup
34
35
  end
35
36
 
36
37
  def register_hooks(core)
@@ -38,16 +39,7 @@ module Kanal
38
39
  input.source = :telegram
39
40
  end
40
41
 
41
- core.hooks.attach :input_before_router do |input|
42
- if input.tg_callback
43
- input.body = input.tg_callback_text
44
- else
45
- input.body = input.tg_text
46
- end
47
- end
48
-
49
42
  core.hooks.attach :output_before_returned do |input, output|
50
- output.tg_text = output.body
51
43
  output.tg_chat_id = input.tg_chat_id
52
44
  end
53
45
  end
@@ -3,6 +3,7 @@
3
3
  require "kanal/core/interfaces/interface"
4
4
  require "kanal/plugins/batteries/batteries_plugin"
5
5
  require_relative "./plugins/telegram_integration_plugin"
6
+ require_relative "./helpers/telegram_link_parser"
6
7
 
7
8
  require "telegram/bot"
8
9
 
@@ -20,76 +21,59 @@ module Kanal
20
21
 
21
22
  @core.register_plugin Kanal::Plugins::Batteries::BatteriesPlugin.new
22
23
  @core.register_plugin Kanal::Interfaces::Telegram::Plugins::TelegramIntegrationPlugin.new
24
+
25
+ @link_parser = Kanal::Interfaces::Telegram::Helpers::TelegramLinkParser.new
23
26
  end
24
27
 
25
28
  def start
26
29
  ::Telegram::Bot::Client.run(@bot_token) do |bot|
27
30
  bot.listen do |message|
28
- puts "message class: #{message.class}"
29
-
30
- if message.instance_of?(::Telegram::Bot::Types::CallbackQuery)
31
- input = @core.create_input
32
-
33
- input.tg_callback = message
34
- input.tg_callback_text = message.data
35
- input.tg_chat_id = message.from.id
36
- input.tg_username = message.from.username
37
-
38
- puts input.tg_username
39
- puts input.tg_chat_id
31
+ router.consume_input create_input message
32
+ end
33
+ end
34
+ end
40
35
 
41
- router.consume_input input
36
+ def consume_output(output)
37
+ send_output @bot, output
38
+ end
42
39
 
43
- # output = router.create_output_for_input input
44
- #
45
- # send_output bot, output
46
- else
47
- input = @core.create_input
40
+ def create_input(message)
41
+ input = @core.create_input
48
42
 
49
- if message.text.nil?
50
- message.text = "EMPTY TEXT"
51
- end
43
+ if !message.instance_variable_defined?(:@data)
44
+ # Regular message received
45
+ input.tg_text = message.text
46
+ input.tg_chat_id = message.chat.id
47
+ input.tg_username = message.chat.username || message.from.username
52
48
 
53
- input.tg_message = message
54
- input.tg_text = message.text
55
- input.tg_chat_id = message.chat.id
56
- input.tg_username = message.chat.username || input.tg_message.from.username
57
-
58
- puts input.tg_username
59
- puts input.tg_chat_id
60
-
61
- if message.photo.count > 0
62
- puts message.photo[0].file_id
63
- file = bot.api.get_file(file_id: message.photo[2].file_id)
64
- file_path = file.dig('result', 'file_path')
65
- photo_url = "https://api.telegram.org/file/bot#{@bot_token}/#{file_path}"
66
- puts photo_url
67
- input.tg_image_link = photo_url
68
- end
49
+ if !message.photo.nil?
50
+ # Array of images contains thumbnails, we take 3rd element to get the high-res image
51
+ input.tg_image_link = @link_parser.get_file_link message.photo.last.file_id, @bot, @bot_token
52
+ end
69
53
 
70
- if message.audio.instance_of?(::Telegram::Bot::Types::Audio)
71
- file = bot.api.get_file(file_id: message.audio.file_id)
72
- file_path = file.dig('result', 'file_path')
73
- audio_url = "https://api.telegram.org/file/bot#{@bot_token}/#{file_path}"
74
- puts audio_url
75
- input.tg_audio_link = audio_url
76
- end
54
+ if !message.audio.nil?
55
+ input.tg_audio_link = @link_parser.get_file_link message.audio.file_id, @bot, @bot_token
56
+ end
77
57
 
78
- router.consume_input input
58
+ if !message.video.nil?
59
+ input.tg_video_link = @link_parser.get_file_link message.video.file_id, @bot, @bot_token
60
+ end
79
61
 
80
- # output = router.create_output_for_input input
81
- #
82
- # send_output bot, output
83
- end
62
+ if !message.document.nil?
63
+ input.tg_document_link = @link_parser.get_file_link message.document.file_id, @bot, @bot_token
84
64
  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
85
70
  end
86
- end
87
71
 
88
- def consume_output(output)
89
- send_output @bot, output
72
+ input
90
73
  end
91
74
 
92
75
  private
76
+
93
77
  def send_output(bot, output)
94
78
  bot.api.send_message(
95
79
  chat_id: output.tg_chat_id,
@@ -111,23 +95,57 @@ module Kanal
111
95
  if !output.tg_audio_path.nil? && File.exist?(audio_path)
112
96
  bot.api.send_audio(
113
97
  chat_id: output.tg_chat_id,
114
- audio: Faraday::UploadIO.new(output.tg_audio_path, "audio/mpeg3")
98
+ audio: Faraday::UploadIO.new(output.tg_audio_path, guess_mimetype(output.tg_audio_path))
99
+ )
100
+ end
101
+
102
+ video_path = output.tg_video_path
103
+
104
+ if !output.tg_video_path.nil? && File.exist?(video_path)
105
+ bot.api.send_video(
106
+ chat_id: output.tg_chat_id,
107
+ video: Faraday::UploadIO.new(output.tg_video_path, guess_mimetype(output.tg_video_path))
108
+ )
109
+ end
110
+
111
+ document_path = output.tg_document_path
112
+
113
+ if !output.tg_document_path.nil? && File.exist?(document_path)
114
+ bot.api.send_document(
115
+ chat_id: output.tg_chat_id,
116
+ document: Faraday::UploadIO.new(output.tg_document_path, guess_mimetype(output.tg_document_path))
115
117
  )
116
118
  end
117
119
  end
118
120
 
119
121
  def guess_mimetype(filename)
120
- images = {
121
- "image/jpeg" => %w[jpg jpeg],
122
- "image/png" => ["png"],
123
- "image/bmp" => ["bmp"]
124
- }
125
-
126
- # TODO: rewrite with .find or .each
127
- for pack in [images] do
128
- for mime, types in pack do
129
- for type in types do
130
- return mime if filename.include? type
122
+ media_types = [
123
+ images: {
124
+ "image/jpeg" => %w[jpg jpeg],
125
+ "image/png" => ["png"],
126
+ "image/bmp" => ["bmp"]
127
+ },
128
+ audios: {
129
+ "audio/mp3" => ["mp3"],
130
+ "audio/ogg" => ["ogg"],
131
+ "audio/vnd.wave" => ["wav"]
132
+ },
133
+ videos: {
134
+ "video/mp4" => ["mp4"],
135
+ "video/webm" => ["webm"]
136
+ },
137
+ documents: {
138
+ "application/msword" => %w[doc docx],
139
+ "application/pdf" => ["pdf"]
140
+ }
141
+ ]
142
+
143
+ media_types.each do |media_type|
144
+ media_type.each do |media_name, variant|
145
+ variant.each do |mime, extensions|
146
+ extensions.each do |extension|
147
+ return mime if filename.include? extension
148
+ end
131
149
  end
132
150
  end
133
151
  end
@@ -3,7 +3,7 @@
3
3
  module Kanal
4
4
  module Interfaces
5
5
  module Telegram
6
- VERSION = "0.3.0"
6
+ VERSION = "0.3.2"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kanal-interfaces-telegram
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - idchlife
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-10 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: telegram-bot-ruby
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
11
+ date: 2023-03-31 00:00:00.000000000 Z
12
+ dependencies: []
27
13
  description: Library provides Telegram interface for Kanal. With this you can connect
28
14
  to telegram bot and control it
29
15
  email:
@@ -32,11 +18,6 @@ executables: []
32
18
  extensions: []
33
19
  extra_rdoc_files: []
34
20
  files:
35
- - ".idea/.gitignore"
36
- - ".idea/kanal-interfaces-telegram.iml"
37
- - ".idea/misc.xml"
38
- - ".idea/modules.xml"
39
- - ".idea/vcs.xml"
40
21
  - ".rspec"
41
22
  - ".rubocop.yml"
42
23
  - ".ruby-version"
@@ -47,8 +28,9 @@ files:
47
28
  - LICENSE.txt
48
29
  - README.md
49
30
  - Rakefile
50
- - kanal-interfaces-telegram.gemspec
31
+ - examples/telegram_bot.rb
51
32
  - lib/kanal/interfaces/telegram.rb
33
+ - lib/kanal/interfaces/telegram/helpers/telegram_link_parser.rb
52
34
  - lib/kanal/interfaces/telegram/plugins/telegram_integration_plugin.rb
53
35
  - lib/kanal/interfaces/telegram/telegram_interface.rb
54
36
  - lib/kanal/interfaces/telegram/version.rb
@@ -61,7 +43,7 @@ metadata:
61
43
  homepage_uri: https://github.com/idchlife/kanal-interfaces-telegram
62
44
  source_code_uri: https://github.com/idchlife/kanal-interfaces-telegram
63
45
  changelog_uri: https://github.com/idchlife/kanal-interfaces-telegram
64
- post_install_message:
46
+ post_install_message:
65
47
  rdoc_options: []
66
48
  require_paths:
67
49
  - lib
@@ -77,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
59
  version: '0'
78
60
  requirements: []
79
61
  rubygems_version: 3.1.6
80
- signing_key:
62
+ signing_key:
81
63
  specification_version: 4
82
64
  summary: This library provides a Telegram interface for Kanal
83
65
  test_files: []
data/.idea/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- # Default ignored files
2
- /shelf/
3
- /workspace.xml
4
- # Editor-based HTTP Client requests
5
- /httpRequests/
6
- # Datasource local storage ignored files
7
- /dataSources/
8
- /dataSources.local.xml
@@ -1,72 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="RUBY_MODULE" version="4">
3
- <component name="ModuleRunConfigurationManager">
4
- <shared />
5
- </component>
6
- <component name="NewModuleRootManager">
7
- <content url="file://$MODULE_DIR$">
8
- <sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
9
- <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
10
- <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
11
- </content>
12
- <orderEntry type="inheritedJdk" />
13
- <orderEntry type="sourceFolder" forTests="false" />
14
- <orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, RVM: ruby-2.7.6) [gem]" level="application" />
15
- <orderEntry type="library" scope="PROVIDED" name="axiom-types (v0.1.1, RVM: ruby-2.7.6) [gem]" level="application" />
16
- <orderEntry type="library" scope="PROVIDED" name="backport (v1.2.0, RVM: ruby-2.7.6) [gem]" level="application" />
17
- <orderEntry type="library" scope="PROVIDED" name="benchmark (v0.2.1, RVM: ruby-2.7.6) [gem]" level="application" />
18
- <orderEntry type="library" scope="PROVIDED" name="bundler (v2.4.5, RVM: ruby-2.7.6) [gem]" level="application" />
19
- <orderEntry type="library" scope="PROVIDED" name="coercible (v1.0.0, RVM: ruby-2.7.6) [gem]" level="application" />
20
- <orderEntry type="library" scope="PROVIDED" name="descendants_tracker (v0.0.4, RVM: ruby-2.7.6) [gem]" level="application" />
21
- <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.5.0, RVM: ruby-2.7.6) [gem]" level="application" />
22
- <orderEntry type="library" scope="PROVIDED" name="docile (v1.4.0, RVM: ruby-2.7.6) [gem]" level="application" />
23
- <orderEntry type="library" scope="PROVIDED" name="dry-inflector (v1.0.0, RVM: ruby-2.7.6) [gem]" level="application" />
24
- <orderEntry type="library" scope="PROVIDED" name="e2mmap (v0.1.0, RVM: ruby-2.7.6) [gem]" level="application" />
25
- <orderEntry type="library" scope="PROVIDED" name="faraday (v2.7.4, RVM: ruby-2.7.6) [gem]" level="application" />
26
- <orderEntry type="library" scope="PROVIDED" name="faraday-multipart (v1.0.4, RVM: ruby-2.7.6) [gem]" level="application" />
27
- <orderEntry type="library" scope="PROVIDED" name="faraday-net_http (v3.0.2, RVM: ruby-2.7.6) [gem]" level="application" />
28
- <orderEntry type="library" scope="PROVIDED" name="ice_nine (v0.11.2, RVM: ruby-2.7.6) [gem]" level="application" />
29
- <orderEntry type="library" scope="PROVIDED" name="jaro_winkler (v1.5.4, RVM: ruby-2.7.6) [gem]" level="application" />
30
- <orderEntry type="library" scope="PROVIDED" name="json (v2.6.3, RVM: ruby-2.7.6) [gem]" level="application" />
31
- <orderEntry type="library" scope="PROVIDED" name="kanal (v0.3.0, RVM: ruby-2.7.6) [gem]" level="application" />
32
- <orderEntry type="library" scope="PROVIDED" name="kramdown (v2.4.0, RVM: ruby-2.7.6) [gem]" level="application" />
33
- <orderEntry type="library" scope="PROVIDED" name="kramdown-parser-gfm (v1.1.0, RVM: ruby-2.7.6) [gem]" level="application" />
34
- <orderEntry type="library" scope="PROVIDED" name="multipart-post (v2.3.0, RVM: ruby-2.7.6) [gem]" level="application" />
35
- <orderEntry type="library" scope="PROVIDED" name="nokogiri (v1.14.0, RVM: ruby-2.7.6) [gem]" level="application" />
36
- <orderEntry type="library" scope="PROVIDED" name="parallel (v1.22.1, RVM: ruby-2.7.6) [gem]" level="application" />
37
- <orderEntry type="library" scope="PROVIDED" name="parser (v3.2.0.0, RVM: ruby-2.7.6) [gem]" level="application" />
38
- <orderEntry type="library" scope="PROVIDED" name="racc (v1.6.2, RVM: ruby-2.7.6) [gem]" level="application" />
39
- <orderEntry type="library" scope="PROVIDED" name="rainbow (v3.1.1, RVM: ruby-2.7.6) [gem]" level="application" />
40
- <orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, RVM: ruby-2.7.6) [gem]" level="application" />
41
- <orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.6.2, RVM: ruby-2.7.6) [gem]" level="application" />
42
- <orderEntry type="library" scope="PROVIDED" name="reverse_markdown (v2.1.1, RVM: ruby-2.7.6) [gem]" level="application" />
43
- <orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.5, RVM: ruby-2.7.6) [gem]" level="application" />
44
- <orderEntry type="library" scope="PROVIDED" name="rspec (v3.12.0, RVM: ruby-2.7.6) [gem]" level="application" />
45
- <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.12.0, RVM: ruby-2.7.6) [gem]" level="application" />
46
- <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.12.2, RVM: ruby-2.7.6) [gem]" level="application" />
47
- <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.12.3, RVM: ruby-2.7.6) [gem]" level="application" />
48
- <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.12.0, RVM: ruby-2.7.6) [gem]" level="application" />
49
- <orderEntry type="library" scope="PROVIDED" name="rubocop (v1.44.1, RVM: ruby-2.7.6) [gem]" level="application" />
50
- <orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.24.1, RVM: ruby-2.7.6) [gem]" level="application" />
51
- <orderEntry type="library" scope="PROVIDED" name="ruby-debug-ide (v0.7.3, RVM: ruby-2.7.6) [gem]" level="application" />
52
- <orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.11.0, RVM: ruby-2.7.6) [gem]" level="application" />
53
- <orderEntry type="library" scope="PROVIDED" name="ruby2_keywords (v0.0.5, RVM: ruby-2.7.6) [gem]" level="application" />
54
- <orderEntry type="library" scope="PROVIDED" name="simplecov (v0.22.0, RVM: ruby-2.7.6) [gem]" level="application" />
55
- <orderEntry type="library" scope="PROVIDED" name="simplecov-html (v0.12.3, RVM: ruby-2.7.6) [gem]" level="application" />
56
- <orderEntry type="library" scope="PROVIDED" name="simplecov_json_formatter (v0.1.4, RVM: ruby-2.7.6) [gem]" level="application" />
57
- <orderEntry type="library" scope="PROVIDED" name="solargraph (v0.48.0, RVM: ruby-2.7.6) [gem]" level="application" />
58
- <orderEntry type="library" scope="PROVIDED" name="telegram-bot-ruby (v0.23.0, RVM: ruby-2.7.6) [gem]" level="application" />
59
- <orderEntry type="library" scope="PROVIDED" name="thor (v1.2.1, RVM: ruby-2.7.6) [gem]" level="application" />
60
- <orderEntry type="library" scope="PROVIDED" name="thread_safe (v0.3.6, RVM: ruby-2.7.6) [gem]" level="application" />
61
- <orderEntry type="library" scope="PROVIDED" name="tilt (v2.0.11, RVM: ruby-2.7.6) [gem]" level="application" />
62
- <orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.4.2, RVM: ruby-2.7.6) [gem]" level="application" />
63
- <orderEntry type="library" scope="PROVIDED" name="virtus (v2.0.0, RVM: ruby-2.7.6) [gem]" level="application" />
64
- <orderEntry type="library" scope="PROVIDED" name="webrick (v1.7.0, RVM: ruby-2.7.6) [gem]" level="application" />
65
- <orderEntry type="library" scope="PROVIDED" name="yard (v0.9.28, RVM: ruby-2.7.6) [gem]" level="application" />
66
- </component>
67
- <component name="RakeTasksCache">
68
- <option name="myRootTask">
69
- <RakeTaskImpl id="rake" />
70
- </option>
71
- </component>
72
- </module>
data/.idea/misc.xml DELETED
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-2.7.6" project-jdk-type="RUBY_SDK" />
4
- </project>
data/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/kanal-interfaces-telegram.iml" filepath="$PROJECT_DIR$/.idea/kanal-interfaces-telegram.iml" />
6
- </modules>
7
- </component>
8
- </project>
data/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>
@@ -1,42 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/kanal/interfaces/telegram/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "kanal-interfaces-telegram"
7
- spec.version = Kanal::Interfaces::Telegram::VERSION
8
- spec.authors = ["idchlife"]
9
- spec.email = ["idchlife@gmail.com"]
10
-
11
- spec.summary = "This library provides a Telegram interface for Kanal"
12
- spec.description = "Library provides Telegram interface for Kanal. With this you can connect to telegram bot and control it"
13
- spec.homepage = "https://github.com/idchlife/kanal-interfaces-telegram"
14
- spec.license = "MIT"
15
- spec.required_ruby_version = ">= 2.7.6"
16
-
17
- spec.metadata["allowed_push_host"] = "https://rubygems.org"
18
-
19
- spec.metadata["homepage_uri"] = spec.homepage
20
- spec.metadata["source_code_uri"] = "https://github.com/idchlife/kanal-interfaces-telegram"
21
- spec.metadata["changelog_uri"] = "https://github.com/idchlife/kanal-interfaces-telegram"
22
-
23
- # spec.add_dependency "kanal", git: "git@github.com:idchlife/kanal.git"
24
- spec.add_dependency "telegram-bot-ruby"
25
-
26
- # Specify which files should be added to the gem when it is released.
27
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
28
- spec.files = Dir.chdir(__dir__) do
29
- `git ls-files -z`.split("\x0").reject do |f|
30
- (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
31
- end
32
- end
33
- spec.bindir = "exe"
34
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
35
- spec.require_paths = ["lib"]
36
-
37
- # Uncomment to register a new dependency of your gem
38
- # spec.add_dependency "example-gem", "~> 1.0"
39
-
40
- # For more information and examples about making a new gem, check out our
41
- # guide at: https://bundler.io/guides/creating_gem.html
42
- end