rubydium 0.4.9 → 0.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e60d3374e73e5b736f438d5f126d2373125ebdd134155af5748db54c5497c7f8
4
- data.tar.gz: 7fbc28fe57860338c8c1f0ba449d5cf2f59d3598a5275f9ef29685ca074f83b9
3
+ metadata.gz: 682cb526a7874d21bbf841da986613751d5e754a1ea154321b82c11785c720f3
4
+ data.tar.gz: 186753e02300ef8daf64f2abf3d7b06190d096613bc2dd8b2d7acf8426720beb
5
5
  SHA512:
6
- metadata.gz: 4d1c16219c8f8ac45b03d06d9cd173a1c82101d1ecfe46897dd02b293956294c12c5f8ac6f34f8f7d95503134f78a6f08db25c82d574711b648e28345f5b9946
7
- data.tar.gz: 95999b5817efbd205a1e3854ceadfb2ecb9d0d74833147f216ab102e538981005095cb2824d74bbd2e87edbb6467d99b8db4d628e2259e507517e92dc8a9f30f
6
+ metadata.gz: 046f20fa1f27f4296e4a938c52d8224c62a8f327dc89516562ba3104e95973b0656f7dfa43193f17d6f90b3adbd66a9fe18a6e4c4edc79163e8a2b28bba5f7bd
7
+ data.tar.gz: 31e2620a69e191653bb9650c150e9b6d65229efa8b4d7e5ed35f90225b7506f411ae94fbc1135a64bfc1c69e853951eb10801108e66cb15a824cef1a2bccc60a
@@ -14,7 +14,7 @@ module Utils
14
14
  end
15
15
 
16
16
  def download_file(voice)
17
- file_path = @api.get_file(file_id: voice.file_id)['result']['file_path']
17
+ file_path = @api.get_file(file_id: voice.file_id).file_path
18
18
 
19
19
  url = "https://api.telegram.org/file/bot#{config.token}/#{file_path}"
20
20
 
@@ -15,8 +15,7 @@ module Rubydium
15
15
  def safe_delete_by_id(id, from_bot: false)
16
16
  return false unless bot_can_delete_messages? || from_bot
17
17
 
18
- result = @api.delete_message(chat_id: @chat.id, message_id: id)
19
- result['ok']
18
+ @api.delete_message(chat_id: @chat.id, message_id: id)
20
19
  rescue Telegram::Bot::Exceptions::ResponseError
21
20
  false
22
21
  end
@@ -8,10 +8,10 @@ module Rubydium
8
8
  return @user_info[user_id] if @user_info[user_id]
9
9
 
10
10
  @user_info[user_id] =
11
- @api.get_chat_member(chat_id: @chat.id, user_id: user_id)['result']
11
+ @api.get_chat_member(chat_id: @chat.id, user_id: user_id)
12
12
  end
13
13
 
14
- boolean_permissions = %w[
14
+ boolean_permissions = %i[
15
15
  can_be_edited
16
16
  can_manage_chat
17
17
  can_change_info
@@ -28,7 +28,7 @@ module Rubydium
28
28
 
29
29
  boolean_permissions.each do |permission|
30
30
  define_method "#{permission}?" do |user_id|
31
- user_info(user_id)[permission] || user_info(user_id)['status'] == 'creator'
31
+ user_info(user_id)[permission] || user_info(user_id)[:status] == 'creator'
32
32
  end
33
33
 
34
34
  define_method "bot_#{permission}?" do
@@ -36,7 +36,7 @@ module Rubydium
36
36
  end
37
37
  end
38
38
 
39
- other_fields = %w[status custom_title]
39
+ other_fields = %i[status custom_title]
40
40
 
41
41
  other_fields.each do |field|
42
42
  define_method field do |user_id|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rubydium
4
- VERSION = '0.4.9'
4
+ VERSION = '0.4.10'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubydium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.4.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - bulgakke