rubydium 0.4.3 → 0.4.5

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: f8da88df665a4644af494bc3cf0ed13935eeebb2db8d71b927ff2f3e818d1ba0
4
+ data.tar.gz: b46f168ef41864b9dc416ee0544c7f2262c8c26c19e705594345349335539cc3
5
5
  SHA512:
6
- metadata.gz: 7b1ce4facdbc052d16fed3686b687ac1b2b06a9b88ed2806911ab6823853df06b43300df9782069c3d516074e3b9b47ad15d5981f53c54d03cae74d3e5fde879
7
- data.tar.gz: 7be8fe5939f7a379868ad9b9707df0672dafeef1f627738d742a65ec80e77c9d218d416ca8c040821c332e438e6dde4e33342b0b78cf422823ed27d81a381334
6
+ metadata.gz: 076e2ec42fbeec569de244888faf4efdbc4b9d6a9ae3c5090465bed009893f7a6dd027290e2192fceda26d1fdb512ccba392c5743cca93825efbbbab95fb31cf
7
+ data.tar.gz: ee7d987228212a34667a3954abd32332fbb51d45844f3ee81e1008ac18c054003eddf2736f47ab1b60eac5afd7d55af5e3b76787b0c267370a60385e652ad3e4
data/lib/rubydium/bot.rb CHANGED
@@ -25,22 +25,24 @@ 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
- rescue StandardError => e
32
- puts e.detailed_message, e.backtrace
33
31
  end
32
+ rescue StandardError => e
33
+ puts e.detailed_message, e.backtrace
34
+ retry
34
35
  end
35
36
  end
36
37
  end
37
38
  end
38
39
 
39
40
  def initialize(client, update)
41
+ @update = update
40
42
  @client = client
41
43
  @api = client.api
42
- @msg = update
43
- @user = @msg.from
44
+ @msg = update.is_a?(Telegram::Bot::Types::Message) ? update : update.message
45
+ @user = update.from
44
46
  @chat = @msg.chat
45
47
  @topic_id = @msg.message_thread_id if @chat.is_forum
46
48
  @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.5"
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.5
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-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: telegram-bot-ruby