rubydium 0.3.12 → 0.3.14

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: 97bb8b30d554f87adf1e78fc3e61b361f23d6b04beadec34e5a8bf94b935369b
4
- data.tar.gz: a80100d0d54f07010ace0069d2717a7323d4cd9096d1ea23f8c39f62d142dfec
3
+ metadata.gz: 0dac94f3bb681c7c2cca9cbdba246a0a9f36e5f2624c8d7118d9b80f71845201
4
+ data.tar.gz: fed91db852852a55bf7330b3f58a37b4cddab676218735fe25af739114b03ebf
5
5
  SHA512:
6
- metadata.gz: c33b975ed62c70b6d345317b707fbd3c1921b91d285dc198675c88154e6a8a07fbdaea03f09b3676651297c38306ea208316048ad3651a5de4fa16a31461e285
7
- data.tar.gz: a60d1697e0f9b83d27432301447b77432907fa6a242f5acd90249baf6d8e9a8b89b35d3a88336efabc8c2591745db2944dbe1384cd15d756a6d00855f954651a
6
+ metadata.gz: 9100a95fa4a72a1a9651a4dff58b15a0b38f43e2a6345880f4b8514d7079628e1811389946ef46d0bab2c7518486d6040b50fe8fc7b18725e6c60d115b93261e
7
+ data.tar.gz: 36b7d2f276b87fa5e1875e3672825320816e8f80653754bb186acd6a677cb0013db84be17dac139dc8afa952a4fdf8eb3c2081fea2cf99f1caf95d781dd9c5a2
@@ -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 @user_info[user_id] if @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.12"
4
+ VERSION = "0.3.14"
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.12
4
+ version: 0.3.14
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