telerb 0.1.5 → 0.1.6

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: 368a13df3fb8d9be794e4c1a1ef14e457b01db5f144c2962a344e93d70bf3921
4
- data.tar.gz: c6117a352b1c0521704ac7ad4abe17149a8018924da52c1197edc2467e80041d
3
+ metadata.gz: 4519b1036ef8a6e632bb946ab50bddbeb3720b34c22a2954e0884ac17415bf0c
4
+ data.tar.gz: dd3819fd1c2c1b4398347feabab1767602d7d23df4f5b7bdf24a2492cded3918
5
5
  SHA512:
6
- metadata.gz: 6707df98472e8704e0e6b92be7bf82b022ef38a82dc110966b0c651bab0acbb053f9a7754dd413d71c8edcf2bd8d9e6dd95a35599b1d6f9a9597cb28b4b529e6
7
- data.tar.gz: c9b863b42643770bfe5244c9cd3ef2bb8bb97012791ab5d80605cd4556dfe2e181a99ffe67c6479d4f4e8fb81c67a3d7957a7428197b73be5b7b2b856092d9b5
6
+ metadata.gz: d6553f171ea7896eba3095f98036def67198762bc1b1a7a350386bb3b435e7b90f96001a87fc569b119eb4f3888894a4c76cc1c936634609b4c742b1a46be26a
7
+ data.tar.gz: a4c7afa38d42eabd4e365a80036fcc2eab5ceb55911086aa40474ffac1a15272a2caeecfa381fc7adaab8fbf07e325f39021b0035665d76a4baac6872432524c
data/README.md CHANGED
@@ -82,6 +82,14 @@ bot.user_info(message)
82
82
 
83
83
  ```
84
84
 
85
+ ### Send Location
86
+
87
+ ```
88
+
89
+ bot.location(chat_id, latitude, longitude, message_id)
90
+
91
+ ```
92
+
85
93
  ## Development
86
94
 
87
95
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TeleRb
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  end
data/lib/telerb.rb CHANGED
@@ -85,6 +85,16 @@ module TeleRb
85
85
  message["from"]
86
86
  end
87
87
 
88
+ def send_location(chat_id, latitude, longitude, reply_to_message_id = nil)
89
+ CLIENT.post("#{@base_uri}#{@token}/sendLocation",
90
+ { chat_id: chat_id, latitude: latitude, longitude: longitude,
91
+ reply_to_message_id: reply_to_message_id })
92
+ "Location Sent with success!"
93
+ rescue StandardError => e
94
+ puts "Error when sending Location: #{e.message}"
95
+ nil
96
+ end
97
+
88
98
  private
89
99
 
90
100
  def send_media(chat_id, media_path, caption = nil, reply_to_message_id = nil, method, filekey)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telerb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - CodeByAllan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-11 00:00:00.000000000 Z
11
+ date: 2024-04-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby library to interact with the Telegram API and create custom bots.
14
14
  email: