Skip to content

Commit 638b5cd

Browse files
authored
Merge pull request #75 from southbridgeio/fix-set-bot-permissions
fix set bot permissions and remove Sidekiq Cron job
2 parents 995187b + 70fce82 commit 638b5cd

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 0.5.4
2+
3+
* Fix set bot permissions
4+
* Remove Sidekiq Cron job for Telegram proxy worker
5+
16
# 0.5.3
27

38
* Add step 3 to Telegram client authorization

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ gem 'sidekiq-rate-limiter', '0.1.3', require: 'sidekiq-rate-limiter/server'
55
gem 'telegram-bot-ruby', '>= 0.11', '< 1.0'
66
gem 'slack-ruby-bot'
77
gem 'celluloid-io'
8-
gem 'tdlib-ruby', git: 'https://github.com/southbridgeio/tdlib-ruby', tag: "v3.0.3"
8+
gem 'tdlib-ruby', git: 'https://github.com/southbridgeio/tdlib-ruby', tag: "v3.0.4"
99
gem 'tdlib-schema', git: 'https://github.com/southbridgeio/tdlib-schema'
1010
gem 'jwt'
1111
gem 'filelock'

init.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
Rails.application.config.eager_load_paths += Dir.glob("#{Rails.application.config.root}/plugins/redmine_bots/{lib,app/workers,app/models,app/controllers,lib/redmine_bots/telegram/{patches/*_patch,hooks/*_hook}}")
2222

2323
Sidekiq::Logging.logger = Logger.new(Rails.root.join('log', 'sidekiq.log'))
24-
Sidekiq::Cron::Job.create(name: 'Telegram proxy monitoring',
25-
cron: '*/3 * * * *',
26-
class: 'TelegramProxyMonitoringWorker')
2724

2825
Redmine::Plugin.register :redmine_bots do
2926
name 'Redmine Bots'

lib/redmine_bots/telegram/tdlib/toggle_chat_admin.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def call(chat_id, user_id, admin = true)
1111
else
1212
TD::Types::ChatMemberStatus::Member.new
1313
end
14-
client.get_user(user_id: user_id).then { client.set_chat_member_status(chat_id: chat_id, member_id: user_id, status: status) }.flat
14+
client.get_user(user_id: user_id).then { client.set_chat_member_status(chat_id: chat_id, member_id: message_sender(user_id), status: status) }.flat
1515
end
1616

1717
private
@@ -35,5 +35,9 @@ def rights
3535
is_anonymous: false
3636
)
3737
end
38+
39+
def message_sender(user_id)
40+
TD::Types::MessageSender::User.new(user_id: user_id)
41+
end
3842
end
3943
end

0 commit comments

Comments
 (0)