зеркало из
https://github.com/glebtv/telegram-bot.git
synced 2026-09-03 17:55:52 +03:00
Support (edited_)channel_post updates, add api methods from 2.3, 2.3.1
Этот коммит содержится в:
@@ -60,30 +60,28 @@ module Telegram
|
||||
raise Error, err_msg
|
||||
end
|
||||
|
||||
# Splited to the sections similar to API docs.
|
||||
%w(
|
||||
deleteWebhook
|
||||
getUpdates
|
||||
getWebhookInfo
|
||||
setWebhook
|
||||
|
||||
answerCallbackQuery
|
||||
answerInlineQuery
|
||||
editMessageCaption
|
||||
editMessageReplyMarkup
|
||||
editMessageText
|
||||
forwardMessage
|
||||
getChat
|
||||
getChatAdministrators
|
||||
getChatMember
|
||||
getChatMembersCount
|
||||
getFile
|
||||
getGameHighScores
|
||||
getMe
|
||||
getUpdates
|
||||
getUserProfilePhotos
|
||||
getWebhookInfo
|
||||
kickChatMember
|
||||
leaveChat
|
||||
sendAudio
|
||||
sendChatAction
|
||||
sendContact
|
||||
sendDocument
|
||||
sendGame
|
||||
sendLocation
|
||||
sendMessage
|
||||
sendPhoto
|
||||
@@ -91,9 +89,17 @@ module Telegram
|
||||
sendVenue
|
||||
sendVideo
|
||||
sendVoice
|
||||
setGameScore
|
||||
setWebhook
|
||||
unbanChatMember
|
||||
|
||||
editMessageCaption
|
||||
editMessageReplyMarkup
|
||||
editMessageText
|
||||
|
||||
answerInlineQuery
|
||||
|
||||
getGameHighScores
|
||||
sendGame
|
||||
setGameScore
|
||||
).each do |method|
|
||||
define_method(method.underscore) { |*args| request(method, *args) }
|
||||
end
|
||||
|
||||
@@ -139,9 +139,9 @@ module Telegram
|
||||
# Helper for asserting message is sent. Note that options are checked
|
||||
# with `hash_including`. For strict checks use #make_telegram_request.
|
||||
def send_telegram_message(bot, text = nil, options = {})
|
||||
description = "send telegram message #{text.inspect}"
|
||||
text = a_string_matching(text) if text.is_a?(Regexp)
|
||||
options = options.merge(text: text) if text
|
||||
description = "send telegram message #{text.inspect}"
|
||||
MakeTelegramRequest.new(bot, :sendMessage, description: description).
|
||||
with(hash_including(options))
|
||||
end
|
||||
|
||||
@@ -80,10 +80,12 @@ module Telegram
|
||||
|
||||
PAYLOAD_TYPES = %w(
|
||||
message
|
||||
edited_message
|
||||
channel_post
|
||||
edited_channel_post
|
||||
inline_query
|
||||
chosen_inline_result
|
||||
callback_query
|
||||
edited_message
|
||||
).freeze
|
||||
CMD_REGEX = %r{\A/([a-z\d_]{,31})(@(\S+))?(\s|$)}i
|
||||
CONFLICT_CMD_REGEX = Regexp.new("^(#{PAYLOAD_TYPES.join('|')}|\\d)")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Telegram
|
||||
module Bot
|
||||
VERSION = '0.10.0'.freeze
|
||||
VERSION = '0.10.1'.freeze
|
||||
|
||||
def self.gem_version
|
||||
Gem::Version.new VERSION
|
||||
|
||||
Ссылка в новой задаче
Block a user