зеркало из
https://github.com/glebtv/telegram-bot.git
synced 2026-09-03 09:46:17 +03:00
Сравнить коммиты
2 Коммитов
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
d1d15d9910 | ||
|
|
e557a217eb |
@@ -1,8 +1,4 @@
|
|||||||
# 0.7.3
|
# 0.7.1
|
||||||
|
|
||||||
- Fixed issues with poller in production (#3)
|
|
||||||
|
|
||||||
# 0.7.2
|
|
||||||
|
|
||||||
- Bot API 2.1
|
- Bot API 2.1
|
||||||
- Fixed possible crashes when payload type is not supported.
|
- Fixed possible crashes when payload type is not supported.
|
||||||
|
|||||||
@@ -1,14 +1,9 @@
|
|||||||
namespace :telegram do
|
namespace :telegram do
|
||||||
namespace :bot do
|
namespace :bot do
|
||||||
desc 'Run poller. It broadcasts Rails.logger to STDOUT in dev like `rails s` do. ' \
|
desc 'Run poller'
|
||||||
'Use LOG_TO_STDOUT to enable/disable broadcasting.'
|
task poller: :environment do
|
||||||
task :poller do
|
console = ActiveSupport::Logger.new(STDERR)
|
||||||
ENV['BOT_POLLER_MODE'] = 'true'
|
Rails.logger.extend ActiveSupport::Logger.broadcast console
|
||||||
Rake::Task['environment'].invoke
|
|
||||||
if ENV.fetch('LOG_TO_STDOUT') { Rails.env.development? }.present?
|
|
||||||
console = ActiveSupport::Logger.new(STDERR)
|
|
||||||
Rails.logger.extend ActiveSupport::Logger.broadcast console
|
|
||||||
end
|
|
||||||
Telegram::Bot::UpdatesPoller.start(ENV['BOT'].try!(:to_sym) || :default)
|
Telegram::Bot::UpdatesPoller.start(ENV['BOT'].try!(:to_sym) || :default)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -71,16 +71,11 @@ module Telegram
|
|||||||
answerCallbackQuery
|
answerCallbackQuery
|
||||||
answerInlineQuery
|
answerInlineQuery
|
||||||
forwardMessage
|
forwardMessage
|
||||||
getChat
|
|
||||||
getChatAdministrators
|
|
||||||
getChatMember
|
|
||||||
getChatMembersCount
|
|
||||||
getFile
|
getFile
|
||||||
getMe
|
getMe
|
||||||
getUpdates
|
getUpdates
|
||||||
getUserProfilePhotos
|
getUserProfilePhotos
|
||||||
kickChatMember
|
kickChatMember
|
||||||
leaveChat
|
|
||||||
sendAudio
|
sendAudio
|
||||||
sendChatAction
|
sendChatAction
|
||||||
sendContact
|
sendContact
|
||||||
|
|||||||
@@ -14,14 +14,9 @@ module Telegram
|
|||||||
# It just tells routes helpers whether to add routed bots to
|
# It just tells routes helpers whether to add routed bots to
|
||||||
# Bot::UpdatesPoller, so their config will be available by bot key in
|
# Bot::UpdatesPoller, so their config will be available by bot key in
|
||||||
# Bot::UpdatesPoller.start.
|
# Bot::UpdatesPoller.start.
|
||||||
#
|
|
||||||
# It's enabled by default in Rails dev environment and `rake telegram:bot:poller`
|
|
||||||
# task. Use `BOT_POLLER_MODE=true` envvar to set it manually.
|
|
||||||
def bot_poller_mode?
|
def bot_poller_mode?
|
||||||
return @bot_poller_mode if defined?(@bot_poller_mode)
|
return @bot_poller_mode if defined?(@bot_poller_mode)
|
||||||
@bot_poller_mode = ENV.fetch('BOT_POLLER_MODE') do
|
Rails.env.development? if defined?(Rails)
|
||||||
Rails.env.development? if defined?(Rails)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Hash of bots made with bots_config.
|
# Hash of bots made with bots_config.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
module Telegram
|
module Telegram
|
||||||
module Bot
|
module Bot
|
||||||
VERSION = '0.7.3'.freeze
|
VERSION = '0.7.1'.freeze
|
||||||
|
|
||||||
def self.gem_version
|
def self.gem_version
|
||||||
Gem::Version.new VERSION
|
Gem::Version.new VERSION
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user