rubydium 0.4.3 → 0.4.4

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: 3c5604d4374a10a86efec305152dd4cbd896416e86c85f17a5a0acdcf4ee4d36
4
- data.tar.gz: aae89b54145092d61bbd74f9e165ae7938265ac97e78f81f9eb761fced0587cc
3
+ metadata.gz: 15d0ee09b07faa8d70f6c00989d84eae50a5c858542a2482eaeaa32a70bf45e1
4
+ data.tar.gz: '020480b4b46a7f1922ba64ea3f50ed7d5aaeb9727a192a02f93f465065e2dd76'
5
5
  SHA512:
6
- metadata.gz: 7b1ce4facdbc052d16fed3686b687ac1b2b06a9b88ed2806911ab6823853df06b43300df9782069c3d516074e3b9b47ad15d5981f53c54d03cae74d3e5fde879
7
- data.tar.gz: 7be8fe5939f7a379868ad9b9707df0672dafeef1f627738d742a65ec80e77c9d218d416ca8c040821c332e438e6dde4e33342b0b78cf422823ed27d81a381334
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) || 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.3"
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.3
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-29 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