rubydium 0.4.8 → 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 +4 -4
- data/.rubocop.yml +2 -2
- data/example/open_ai_bot/utils.rb +1 -1
- data/lib/rubydium/bot.rb +1 -1
- data/lib/rubydium/mixins/other_actions.rb +1 -2
- data/lib/rubydium/mixins/rights_checking.rb +4 -4
- data/lib/rubydium/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 682cb526a7874d21bbf841da986613751d5e754a1ea154321b82c11785c720f3
|
4
|
+
data.tar.gz: 186753e02300ef8daf64f2abf3d7b06190d096613bc2dd8b2d7acf8426720beb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 046f20fa1f27f4296e4a938c52d8224c62a8f327dc89516562ba3104e95973b0656f7dfa43193f17d6f90b3adbd66a9fe18a6e4c4edc79163e8a2b28bba5f7bd
|
7
|
+
data.tar.gz: 31e2620a69e191653bb9650c150e9b6d65229efa8b4d7e5ed35f90225b7506f411ae94fbc1135a64bfc1c69e853951eb10801108e66cb15a824cef1a2bccc60a
|
data/.rubocop.yml
CHANGED
@@ -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)
|
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
|
|
data/lib/rubydium/bot.rb
CHANGED
@@ -25,7 +25,7 @@ module Rubydium
|
|
25
25
|
# Not all `update`s here are messages (`listen` yields `Update#current_message`,
|
26
26
|
# which can be `ChatMemberUpdated` etc.)
|
27
27
|
# TODO: rework to allow for clean handling of other types.
|
28
|
-
if update.is_a? Telegram::Bot::Types::
|
28
|
+
if update.is_a?(Telegram::Bot::Types::Message) || update.is_a?(Telegram::Bot::Types::CallbackQuery)
|
29
29
|
new(client, update).handle_update
|
30
30
|
end
|
31
31
|
rescue StandardError => e
|
@@ -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
|
-
|
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)
|
11
|
+
@api.get_chat_member(chat_id: @chat.id, user_id: user_id)
|
12
12
|
end
|
13
13
|
|
14
|
-
boolean_permissions = %
|
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)[
|
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 = %
|
39
|
+
other_fields = %i[status custom_title]
|
40
40
|
|
41
41
|
other_fields.each do |field|
|
42
42
|
define_method field do |user_id|
|
data/lib/rubydium/version.rb
CHANGED