telegram-bot 0.15.3 → 0.15.4

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: 7cb3d6a6238c7d07cf8b6f33743dc5bc5a5442b9695f716cd22098b9dae341a6
4
- data.tar.gz: 3d0d9ff96175d7e63041d2f76048f158f75fcc19bd059270e479e4034a21db3f
3
+ metadata.gz: ce64ac3361d5b02948e28ddef05bdc084ea6f6681889bda5ccd2d77e544f3a91
4
+ data.tar.gz: 02f9adbc5cb3fc0af167c7f55c7bf716a9fef3f88706339be9948e50c410d11a
5
5
  SHA512:
6
- metadata.gz: d406dace6502e17764530733200f9f1d5a14d496087b35449a086675e1c15cd3cdcc71119e744422338f5367f75fffb82abc793dcc17f08c30b76565d487fd52
7
- data.tar.gz: 97e4323e43fee40885628fadeb179edeff9d3d73da12e8803dfbf2ce36e2ec5ac94b7499da14721e4cedee44ca38dc9d1d36a5cf21b2c4918bb8f48230e2a794
6
+ metadata.gz: 9b85de3de3da3f5adea3412a1642f6dbe831ed3b79d6a228eddf210c3ba6228396b9e9c69513848331d0a04261a6623487e7b1db8b5268aced95f18624225e49
7
+ data.tar.gz: 396074577bc0bbe7f7bb189408ec5134d66a44629928a95bd0fa60ec43474be60bb110f778d4de65d3d96ce4ffedd50436c88219df1198928bc4655a4c014143
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Unreleased
2
2
 
3
+ # 0.15.4
4
+
5
+ - Update to Bot API 5.3
6
+
3
7
  # 0.15.3
4
8
 
5
9
  - Ruby 3.0 support: fix translation helpers.
data/Gemfile CHANGED
@@ -8,7 +8,7 @@ group :development do
8
8
  gem 'pry-byebug', '~> 3.9.0'
9
9
  gem 'sdoc', '~> 2.0.3'
10
10
 
11
- gem 'telegram-bot-types', '~> 0.6.2'
11
+ gem 'telegram-bot-types', '~> 0.6.3'
12
12
 
13
13
  gem 'rspec', '~> 3.10.0'
14
14
  gem 'rspec-its', '~> 1.3.0'
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/telegram-bot.svg)](http://badge.fury.io/rb/telegram-bot)
4
4
  [![Code Climate](https://codeclimate.com/github/telegram-bot-rb/telegram-bot/badges/gpa.svg)](https://codeclimate.com/github/telegram-bot-rb/telegram-bot)
5
- [![Build Status](https://travis-ci.org/telegram-bot-rb/telegram-bot.svg)](https://travis-ci.org/telegram-bot-rb/telegram-bot)
5
+ [![Build Status](https://travis-ci.com/telegram-bot-rb/telegram-bot.svg)](https://travis-ci.com/telegram-bot-rb/telegram-bot)
6
6
 
7
7
  Tools for developing Telegram bots. Best used with Rails, but can be used in
8
8
  [standalone app](https://github.com/telegram-bot-rb/telegram-bot/wiki/Not-rails-application).
@@ -25,9 +25,33 @@ with session, keyboards and inline queries.
25
25
  Run it on your local machine in 1 minute!
26
26
 
27
27
  And here is [app template](https://github.com/telegram-bot-rb/rails_template)
28
- to generate clean app in seconds.
29
-
30
- Examples and cookbook in [wiki](https://github.com/telegram-bot-rb/telegram-bot/wiki).
28
+ to generate new rails app in seconds.
29
+
30
+ See examples and cookbook in [the wiki](https://github.com/telegram-bot-rb/telegram-bot/wiki).
31
+
32
+ ## Table of Contents
33
+
34
+ * [Installation](#installation)
35
+ * [Usage](#usage)
36
+ * [Configuration](#configuration)
37
+ * [Configuration in Rails app](#configuration-in-rails-app)
38
+ * [Client](#client)
39
+ * [Typed responses](#typed-responses)
40
+ * [Controller](#controller)
41
+ * [Reply helpers](#reply-helpers)
42
+ * [Optional typecasting](#optional-typecasting)
43
+ * [Session](#session)
44
+ * [Message context](#message-context)
45
+ * [Callback queries](#callback-queries)
46
+ * [Routes in Rails app](#routes-in-rails-app)
47
+ * [Processing updates](#processing-updates)
48
+ * [Development & Debugging](#development--debugging)
49
+ * [Testing](#testing)
50
+ * [Deployment](#deployment)
51
+ * [Async mode](#async-mode)
52
+ * [Limitations](#limitations)
53
+ * [Development](#development)
54
+ * [Contributing](#contributing)
31
55
 
32
56
  ## Installation
33
57
 
@@ -39,11 +63,15 @@ gem 'telegram-bot'
39
63
 
40
64
  And then execute:
41
65
 
42
- $ bundle
66
+ ```
67
+ bundle
68
+ ```
43
69
 
44
70
  Or install it yourself as:
45
71
 
46
- $ gem install telegram-bot
72
+ ```
73
+ gem install telegram-bot
74
+ ```
47
75
 
48
76
  Require if necessary:
49
77
 
@@ -170,19 +198,18 @@ Bot controllers like usual rails controllers provides features like callbacks,
170
198
 
171
199
  ```ruby
172
200
  class Telegram::WebhookController < Telegram::Bot::UpdatesController
173
- # use callbacks like in any other controllers
201
+ # use callbacks like in any other controller
174
202
  around_action :with_locale
175
203
 
176
- # Every update can have one of: message, inline_query, chosen_inline_result,
204
+ # Every update has one of: message, inline_query, chosen_inline_result,
177
205
  # callback_query, etc.
178
- # Define method with same name to respond to this updates.
206
+ # Define method with the same name to handle this type of update.
179
207
  def message(message)
180
- # message can be also accessed via instance method
181
- message == self.payload # true
182
208
  # store_message(message['text'])
183
209
  end
184
210
 
185
- # This basic methods receives commonly used params:
211
+ # For the following types of updates commonly used params are passed as arguments,
212
+ # full payload object is available with `payload` instance method.
186
213
  #
187
214
  # message(payload)
188
215
  # inline_query(query, offset)
@@ -193,14 +220,19 @@ class Telegram::WebhookController < Telegram::Bot::UpdatesController
193
220
  # Command arguments will be parsed and passed to the method.
194
221
  # Be sure to use splat args and default values to not get errors when
195
222
  # someone passed more or less arguments in the message.
196
- def start!(data = nil, *)
197
- # do_smth_with(data)
223
+ def start!(word = nil, *other_words)
224
+ # do_smth_with(word)
225
+
226
+ # full message object is also available via `payload` instance method:
227
+ # process_raw_message(payload['text'])
198
228
 
199
229
  # There are `chat` & `from` shortcut methods.
200
- # For callback queries `chat` if taken from `message` when it's available.
230
+ # For callback queries `chat` is taken from `message` when it's available.
201
231
  response = from ? "Hello #{from['username']}!" : 'Hi there!'
232
+
202
233
  # There is `respond_with` helper to set `chat_id` from received message:
203
234
  respond_with :message, text: response
235
+
204
236
  # `reply_with` also sets `reply_to_message_id`:
205
237
  reply_with :photo, photo: File.open('party.jpg')
206
238
  end
@@ -223,10 +255,10 @@ end
223
255
 
224
256
  #### Reply helpers
225
257
 
226
- There are helpers to respond for basic actions. They just set chat/message/query
227
- identifiers from update. See
258
+ There are helpers for basic responses. They just set chat/message/query
259
+ identifiers from the update. See
228
260
  [`ReplyHelpers`](https://github.com/telegram-bot-rb/telegram-bot/blob/master/lib/telegram/bot/updates_controller/reply_helpers.rb)
229
- module for more information. Here are this methods signatures:
261
+ module for more information. Here are these methods signatures:
230
262
 
231
263
  ```ruby
232
264
  def respond_with(type, params); end
@@ -389,7 +421,7 @@ telegram_webhook TelegramAuctionController, :auction
389
421
  telegram_webhook TelegramController, as: :custom_telegram_webhook
390
422
  ```
391
423
 
392
- #### Processesing updates
424
+ #### Processing updates
393
425
 
394
426
  To process update with controller call `.dispatch(bot, update)` on it.
395
427
  There are several options to run it automatically:
@@ -1,5 +1,5 @@
1
1
  # Generated with bin/fetch-telegram-methods
2
- # Bot API 5.0
2
+ # Bot API 5.3
3
3
 
4
4
  getUpdates
5
5
  setWebhook
@@ -30,13 +30,16 @@ sendDice
30
30
  sendChatAction
31
31
  getUserProfilePhotos
32
32
  getFile
33
- kickChatMember
33
+ banChatMember
34
34
  unbanChatMember
35
35
  restrictChatMember
36
36
  promoteChatMember
37
37
  setChatAdministratorCustomTitle
38
38
  setChatPermissions
39
39
  exportChatInviteLink
40
+ createChatInviteLink
41
+ editChatInviteLink
42
+ revokeChatInviteLink
40
43
  setChatPhoto
41
44
  deleteChatPhoto
42
45
  setChatTitle
@@ -47,12 +50,13 @@ unpinAllChatMessages
47
50
  leaveChat
48
51
  getChat
49
52
  getChatAdministrators
50
- getChatMembersCount
53
+ getChatMemberCount
51
54
  getChatMember
52
55
  setChatStickerSet
53
56
  deleteChatStickerSet
54
57
  answerCallbackQuery
55
58
  setMyCommands
59
+ deleteMyCommands
56
60
  getMyCommands
57
61
 
58
62
  editMessageText
@@ -99,6 +99,8 @@ module Telegram
99
99
  pre_checkout_query
100
100
  poll
101
101
  poll_answer
102
+ my_chat_member
103
+ chat_member
102
104
  ].freeze
103
105
 
104
106
  class << self
@@ -1,6 +1,6 @@
1
1
  module Telegram
2
2
  module Bot
3
- VERSION = '0.15.3'.freeze
3
+ VERSION = '0.15.4'.freeze
4
4
 
5
5
  def self.gem_version
6
6
  Gem::Version.new VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telegram-bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.3
4
+ version: 0.15.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Melentiev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-15 00:00:00.000000000 Z
11
+ date: 2021-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack