boppers 0.0.7 → 0.0.8

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
  SHA1:
3
- metadata.gz: 2b1c29cc1acc244f2de34249d79c2750558eee94
4
- data.tar.gz: 2a090b9c2ff1e33bc10f87efb2784051455710d6
3
+ metadata.gz: d1e8512a3d75ad25183e69b5ba639cf6aafc1c57
4
+ data.tar.gz: bde111d6ff7f23f5274b73b18c5c1d3fb95a8f9e
5
5
  SHA512:
6
- metadata.gz: 4b183e0cc4b2096977869d3039be89ddd319c02e248153ac2e10dcd0947d0314a8ebf99886b500df747be32b3b3e800088694793dc8df8f789bf363b89177741
7
- data.tar.gz: 3b77cd4321f576482d50b6d48a5ba9d30071888371b4573427489e1747a1c6d269dd2d8621e896b5e605fb27c4852ab95a2744a7045c8e2845379b064201f3a7
6
+ metadata.gz: a3db28ba81b7a6199bfc446ecbaee34ddaabe32f68caad8edd21f498efda9161994c8f1b0d7eb146bbfb4f26fa344faea9c12d886a44a0164f8da7cb1dba0c29
7
+ data.tar.gz: 39f51b0597ae7635bdbc4c19c80db4174c4989a9dbcb5075f3d9762bd75d555074fdd83b8e0f02f857aed0133d3537be18805238f3caaa2fdb73ec1b1b16b83f
data/gems.locked CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- boppers (0.0.7)
4
+ boppers (0.0.8)
5
5
  aitch
6
6
  thor
7
7
 
@@ -13,12 +13,20 @@ module Boppers
13
13
  @subscribe = subscribe
14
14
  end
15
15
 
16
- def call(title, message, _options)
17
- bot = TelegramBot.new(token: api_token)
16
+ def call(title, message, options)
17
+ telegram_options = options.fetch(:telegram, {})
18
+ title = telegram_options.delete(:title) { title }
19
+ message = telegram_options.delete(:message) { message }
18
20
 
21
+ bot = TelegramBot.new(token: api_token)
19
22
  notification = TelegramBot::OutMessage.new
20
23
  notification.chat = TelegramBot::Channel.new(id: channel_id)
21
24
  notification.text = "#{title}\n\n#{message}"
25
+
26
+ telegram_options.each do |key, value|
27
+ notification.public_send("#{key}=", value)
28
+ end
29
+
22
30
  notification.send_with(bot)
23
31
  end
24
32
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Boppers
4
- VERSION = "0.0.7"
4
+ VERSION = "0.0.8"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boppers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira