rubydium 0.3.11 → 0.3.13

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: fd0eb1502674be02b220ba6dd98163edcfe8c8199f8bdfffe23bd54773f22bb9
4
- data.tar.gz: c07ea74daaaecebc0cff6d2e1fa36b302f63549edec3429f6294d4caf19f28c6
3
+ metadata.gz: f9f3102dcc6c4c6d9614d286270883a6e66eec4d018be03e8adbf516a3b25b44
4
+ data.tar.gz: 012e1733a6cce77c9c90d4840dfd699a1df36f03176ca738780bc3cee34290e5
5
5
  SHA512:
6
- metadata.gz: 83263e4fa1d630376e7bb7a18933d4437df13947d5c3f6395c78c0f4ff894130505428d2317948c48e71bbf4dc213954aeafd42aff068b78eed9260919b2d98a
7
- data.tar.gz: 494ef7bb4c17a418567aeb22a6db79513365adc5985121493ef249041a4f9220858cd5b657902b5159e11018a4b1fb8be0cd4d51abc65f35e9e8f67e55503668
6
+ metadata.gz: cb6762c57c855da66dfc6085e2b2402114120b84392a8c115e69c50b17ea33dbc04da83fdc4754d22d2a991a2402ea7cc33f10b6d4fc01734955dd56afec9282
7
+ data.tar.gz: e38f463cac02be9d2ed724cee66ca98ecc750fda83171b69dc3c9f3a81d839156461bbea0244250aa27329a8fa1b6de5158a292fb3be7fdd2245bb3e506410da
@@ -86,7 +86,7 @@ module Rubydium
86
86
  }
87
87
 
88
88
  @registered_commands.merge!(
89
- [command, **aliases].map { |comm|
89
+ [command, *aliases].map { |comm|
90
90
  [comm, parameters]
91
91
  }.to_h
92
92
  )
@@ -2,7 +2,10 @@ module Rubydium
2
2
  module Mixins
3
3
  module RightsChecking
4
4
  def user_info(user_id=config.bot_id)
5
- @user_info ||= @api.get_chat_member(chat_id: @chat.id, user_id: user_id).dig("result")
5
+ @user_info ||= {}
6
+ return info if info = @user_info[user_id]
7
+
8
+ @user_info[user_id] = @api.get_chat_member(chat_id: @chat.id, user_id: user_id).dig("result")
6
9
  end
7
10
 
8
11
  boolean_permissions = %w[
@@ -22,7 +25,7 @@ module Rubydium
22
25
 
23
26
  boolean_permissions.each do |permission|
24
27
  define_method "#{permission}?" do |user_id|
25
- user_info(user_id).dig(permission)
28
+ user_info(user_id).dig(permission) || user_info(user_id)["status"] == "creator"
26
29
  end
27
30
 
28
31
  define_method "bot_#{permission}?" do
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rubydium
4
- VERSION = "0.3.11"
4
+ VERSION = "0.3.13"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubydium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.11
4
+ version: 0.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - bulgakke
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-02 00:00:00.000000000 Z
11
+ date: 2023-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: telegram-bot-ruby