rubydium 0.4.2 → 0.4.4

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: 6c1427ca9d17164a93ec242c30d21dcf6466ee5281e0ae5e3051b1870a649392
4
- data.tar.gz: '049b14d607f9e8e899af406321e5c6bef2cc65720eda7bfd048f0eecb2de6a15'
3
+ metadata.gz: 15d0ee09b07faa8d70f6c00989d84eae50a5c858542a2482eaeaa32a70bf45e1
4
+ data.tar.gz: '020480b4b46a7f1922ba64ea3f50ed7d5aaeb9727a192a02f93f465065e2dd76'
5
5
  SHA512:
6
- metadata.gz: 165a40f2b32eb13ac2c3d393e57f8158d0d4b8c80760fa0956c3c77a600b8b7f372fa9109326d903230f89930b825b9214375a1ddee09ae0acc1b3060406ec1c
7
- data.tar.gz: 96d436a66ccedfbff6e32c1c5a1806fde6e6b2b7468a11ef460a2ade3f818837c655686fdd1cde6c3e2b4f29214219b2c47b66ece052607a2890861c31004693
6
+ metadata.gz: 44feadf24157c2d1062926da61d61f2bfa9d2528bba48fda277c4486442a1690d173d18ff96fea802a1dc032d858307e3e1a045a54009e0a1b3102e344fda7a9
7
+ data.tar.gz: c2ff0f1025e03c928ccdb01535a9b2ddbef70f8b88807a95d0a57b8a988f763a88e344905e922a70b52fb43d8bec44ea48c68d6c5832766c11632965e18c9ec9
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::Message
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
@@ -37,10 +37,11 @@ module Rubydium
37
37
  end
38
38
 
39
39
  def initialize(client, update)
40
+ @update = update
40
41
  @client = client
41
42
  @api = client.api
42
- @msg = update
43
- @user = @msg.from
43
+ @msg = update.is_a?(Telegram::Bot::Types::Message) ? update : update.message
44
+ @user = update.from
44
45
  @chat = @msg.chat
45
46
  @topic_id = @msg.message_thread_id if @chat.is_forum
46
47
  @replies_to = @msg.reply_to_message unless @msg.reply_to_message&.message_id == @topic_id
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rubydium
4
- VERSION = "0.4.2"
4
+ VERSION = "0.4.4"
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.4.2
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - bulgakke
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-07 00:00:00.000000000 Z
11
+ date: 2024-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: telegram-bot-ruby