fastlane-plugin-telegram_sender 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81729af09c7148d8a877739d10ea2338868b1052f80477f81099403b09a2a44a
|
4
|
+
data.tar.gz: 5945a4cddfb132b766ea7fedb36a6e256e7dac59f9c2afa93331d723393766e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a51e0dd1b93c4dd8a0b9a8213ed11817f94d44749acb875ebc6da7e96230f5498820186b6b91e8f2100497e07d57b5adf4243747479f1da0fc5dfa5e85b22cb
|
7
|
+
data.tar.gz: 82e6ba68fa9e4b9c03d5fe34efd2855d54638ea957ff0148dec6bd94e641d71079358e6de763b23c6f79666086c47aea42fa1572f912dadccab033ae88714cec
|
data/README.md
CHANGED
@@ -10,11 +10,19 @@ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To
|
|
10
10
|
fastlane add_plugin telegram_sender
|
11
11
|
```
|
12
12
|
|
13
|
-
## About
|
14
|
-
|
15
|
-
Allows post messages to telegram
|
16
|
-
|
17
|
-
|
13
|
+
## About telegram
|
14
|
+
|
15
|
+
Allows post messages to telegram chats and topics
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
telegram(
|
19
|
+
token: ENV['TG_BOT_TOKEN'], # get token from @BotFather
|
20
|
+
chat_id: ENV['TG_CHAT_ID'], # https://stackoverflow.com/questions/33858927/how-to-obtain-the-chat-id-of-a-private-telegram-channel
|
21
|
+
message_thread_id: ENV['TG_MESSAGE_THREAD_ID'], # message_thread_id of topic
|
22
|
+
animation: ENV['ANIMATION_ID'], # Pass a file_id as String to send an animation that exists on the Telegram servers
|
23
|
+
text: "Hello world, Telegram!" # Required
|
24
|
+
)
|
25
|
+
```
|
18
26
|
|
19
27
|
## Example
|
20
28
|
|
@@ -9,8 +9,11 @@ module Fastlane
|
|
9
9
|
message_thread_id = params[:message_thread_id]
|
10
10
|
text = params[:text]
|
11
11
|
parse_mode = params[:parse_mode]
|
12
|
+
animation = params[:animation]
|
12
13
|
|
13
|
-
|
14
|
+
method = (animation == nil ? "sendMessage" : "sendAnimation")
|
15
|
+
textParam = (animation == nil ? "text" : "caption")
|
16
|
+
uri = URI.parse("https://api.telegram.org/bot#{token}/#{method}")
|
14
17
|
|
15
18
|
http = Net::HTTP.new(uri.host, uri.port)
|
16
19
|
if params[:proxy]
|
@@ -24,7 +27,8 @@ module Fastlane
|
|
24
27
|
{
|
25
28
|
"chat_id" => chat_id,
|
26
29
|
"message_thread_id" => message_thread_id,
|
27
|
-
"
|
30
|
+
"#{textParam}" => text,
|
31
|
+
"animation" => animation,
|
28
32
|
"parse_mode" => parse_mode
|
29
33
|
})
|
30
34
|
|
@@ -64,6 +68,11 @@ module Fastlane
|
|
64
68
|
description: "Unique identifier for the target topic (not in the format @channel). For getting chat id you can send any message to your bot and get chat id from response https://api.telegram.org/botYOUR_TOKEN/getupdates",
|
65
69
|
optional: true,
|
66
70
|
type: String),
|
71
|
+
FastlaneCore::ConfigItem.new(key: :animation,
|
72
|
+
env_name: "ANIMATION_ID",
|
73
|
+
description: "Pass a file_id as String to send an animation that exists on the Telegram servers",
|
74
|
+
optional: true,
|
75
|
+
type: String),
|
67
76
|
FastlaneCore::ConfigItem.new(key: :text,
|
68
77
|
env_name: "TELEGRAM_TEXT",
|
69
78
|
description: "Text of the message to be sent",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-telegram_sender
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmytro Doroschuk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|