telegram-bot 0.10.0 → 0.10.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 +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile +1 -1
- data/README.md +3 -0
- data/lib/telegram/bot/client.rb +16 -10
- data/lib/telegram/bot/rspec/client_matchers.rb +1 -1
- data/lib/telegram/bot/updates_controller.rb +3 -1
- data/lib/telegram/bot/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 88e165797e0f92ef0f7e41461e82f8a0cb98d6ca
|
|
4
|
+
data.tar.gz: f6fc59a4da9fb8f3d8d7415318a0ce62c68a677b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 66cddb0e63f11fa39870821bcf1b1c67c5e7904462a01e1409d3ed60f6f98152f024dd7fa6c5f5b816c8ceead7f33d264438c6242a5ffaae87d1c8815d70dd15
|
|
7
|
+
data.tar.gz: fa43ea5cdd2b436453848de61ebd3b8df80b0774ffedba10ff4bc327bffef89b1cafa79ae8a4ec675033fcac06250b90d2133055f81d54de7e45b5a085965b18
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -24,6 +24,9 @@ Here is sample [telegram_bot_app](https://github.com/telegram-bot-rb/telegram_bo
|
|
|
24
24
|
with session, keyboards and inline queries.
|
|
25
25
|
Run it on your local machine in 1 minute!
|
|
26
26
|
|
|
27
|
+
And here is [app teamplate](https://github.com/telegram-bot-rb/rails_template)
|
|
28
|
+
to generate clean app in seconds.
|
|
29
|
+
|
|
27
30
|
## Installation
|
|
28
31
|
|
|
29
32
|
Add this line to your application's Gemfile:
|
data/lib/telegram/bot/client.rb
CHANGED
|
@@ -60,30 +60,28 @@ module Telegram
|
|
|
60
60
|
raise Error, err_msg
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
+
# Splited to the sections similar to API docs.
|
|
63
64
|
%w(
|
|
65
|
+
deleteWebhook
|
|
66
|
+
getUpdates
|
|
67
|
+
getWebhookInfo
|
|
68
|
+
setWebhook
|
|
69
|
+
|
|
64
70
|
answerCallbackQuery
|
|
65
|
-
answerInlineQuery
|
|
66
|
-
editMessageCaption
|
|
67
|
-
editMessageReplyMarkup
|
|
68
|
-
editMessageText
|
|
69
71
|
forwardMessage
|
|
70
72
|
getChat
|
|
71
73
|
getChatAdministrators
|
|
72
74
|
getChatMember
|
|
73
75
|
getChatMembersCount
|
|
74
76
|
getFile
|
|
75
|
-
getGameHighScores
|
|
76
77
|
getMe
|
|
77
|
-
getUpdates
|
|
78
78
|
getUserProfilePhotos
|
|
79
|
-
getWebhookInfo
|
|
80
79
|
kickChatMember
|
|
81
80
|
leaveChat
|
|
82
81
|
sendAudio
|
|
83
82
|
sendChatAction
|
|
84
83
|
sendContact
|
|
85
84
|
sendDocument
|
|
86
|
-
sendGame
|
|
87
85
|
sendLocation
|
|
88
86
|
sendMessage
|
|
89
87
|
sendPhoto
|
|
@@ -91,9 +89,17 @@ module Telegram
|
|
|
91
89
|
sendVenue
|
|
92
90
|
sendVideo
|
|
93
91
|
sendVoice
|
|
94
|
-
setGameScore
|
|
95
|
-
setWebhook
|
|
96
92
|
unbanChatMember
|
|
93
|
+
|
|
94
|
+
editMessageCaption
|
|
95
|
+
editMessageReplyMarkup
|
|
96
|
+
editMessageText
|
|
97
|
+
|
|
98
|
+
answerInlineQuery
|
|
99
|
+
|
|
100
|
+
getGameHighScores
|
|
101
|
+
sendGame
|
|
102
|
+
setGameScore
|
|
97
103
|
).each do |method|
|
|
98
104
|
define_method(method.underscore) { |*args| request(method, *args) }
|
|
99
105
|
end
|
|
@@ -139,9 +139,9 @@ module Telegram
|
|
|
139
139
|
# Helper for asserting message is sent. Note that options are checked
|
|
140
140
|
# with `hash_including`. For strict checks use #make_telegram_request.
|
|
141
141
|
def send_telegram_message(bot, text = nil, options = {})
|
|
142
|
+
description = "send telegram message #{text.inspect}"
|
|
142
143
|
text = a_string_matching(text) if text.is_a?(Regexp)
|
|
143
144
|
options = options.merge(text: text) if text
|
|
144
|
-
description = "send telegram message #{text.inspect}"
|
|
145
145
|
MakeTelegramRequest.new(bot, :sendMessage, description: description).
|
|
146
146
|
with(hash_including(options))
|
|
147
147
|
end
|
|
@@ -80,10 +80,12 @@ module Telegram
|
|
|
80
80
|
|
|
81
81
|
PAYLOAD_TYPES = %w(
|
|
82
82
|
message
|
|
83
|
+
edited_message
|
|
84
|
+
channel_post
|
|
85
|
+
edited_channel_post
|
|
83
86
|
inline_query
|
|
84
87
|
chosen_inline_result
|
|
85
88
|
callback_query
|
|
86
|
-
edited_message
|
|
87
89
|
).freeze
|
|
88
90
|
CMD_REGEX = %r{\A/([a-z\d_]{,31})(@(\S+))?(\s|$)}i
|
|
89
91
|
CONFLICT_CMD_REGEX = Regexp.new("^(#{PAYLOAD_TYPES.join('|')}|\\d)")
|
data/lib/telegram/bot/version.rb
CHANGED
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.10.
|
|
4
|
+
version: 0.10.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Max Melentiev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-12-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|