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 +4 -4
- data/gems.locked +1 -1
- data/lib/boppers/notifier/telegram.rb +10 -2
- data/lib/boppers/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1e8512a3d75ad25183e69b5ba639cf6aafc1c57
|
4
|
+
data.tar.gz: bde111d6ff7f23f5274b73b18c5c1d3fb95a8f9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3db28ba81b7a6199bfc446ecbaee34ddaabe32f68caad8edd21f498efda9161994c8f1b0d7eb146bbfb4f26fa344faea9c12d886a44a0164f8da7cb1dba0c29
|
7
|
+
data.tar.gz: 39f51b0597ae7635bdbc4c19c80db4174c4989a9dbcb5075f3d9762bd75d555074fdd83b8e0f02f857aed0133d3537be18805238f3caaa2fdb73ec1b1b16b83f
|
data/gems.locked
CHANGED
@@ -13,12 +13,20 @@ module Boppers
|
|
13
13
|
@subscribe = subscribe
|
14
14
|
end
|
15
15
|
|
16
|
-
def call(title, message,
|
17
|
-
|
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
|
data/lib/boppers/version.rb
CHANGED