rubydium 0.3.0 → 0.3.2

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: a50bfd6f358154dfca5a595b467c9c0604160877dffe0266da927a134a41360f
4
- data.tar.gz: 3afaba84242a07fcf5f9c31df0d6eb6927e4f821d7ec4fbcfcdc12d2b0a797c9
3
+ metadata.gz: '06454492015a165a13f48b512e35f28d01c23d971f2e747a63db539f99a74dba'
4
+ data.tar.gz: 992290fd34805a84438d848067e2281b13d6542e80671160bbf46f8699cdb353
5
5
  SHA512:
6
- metadata.gz: 5453bb526aa757ab9011463b620079f17d67269013a347496416e623115122c6e793c2bdfd90a19b2886ecd9ba5c8924418f75341bf828315ef155f86365e179
7
- data.tar.gz: a712f2f38cb8f47f428f9837c7283de9168e6875e5a84d584749940ca831e272874dc08b77e6b8dbe61b335ad0cda648d40baf4f8b19ee9f3cbc5dcf40bb3ef8
6
+ metadata.gz: ce02e7b72e9459d4fa11deb91a26a40e8987831e6169019f5c6376796effda5207dfff30ea6216b8f481439665a89987708d368109233fe0e07d46236ace3d12
7
+ data.tar.gz: 2bb0b1579d55d817779ede9f4a672517a9630f2a84274901018b9d31286cf44541dc3b777cf0377ef482dca68f99bea5ce51ad0113b224a7491fa7cf3fd37cec
data/lib/rubydium/bot.rb CHANGED
@@ -42,7 +42,8 @@ module Rubydium
42
42
  @msg = update
43
43
  @user = @msg.from
44
44
  @chat = @msg.chat
45
- @replies_to = @msg.reply_to_message
45
+ @topic_id = @msg.message_thread_id if @chat.is_forum
46
+ @replies_to = @msg.reply_to_message unless @msg.reply_to_message.id == @topic_id
46
47
  @target = @replies_to&.from
47
48
  @text = @msg.text.to_s
48
49
  @message_id = @msg.message_id
@@ -50,7 +51,6 @@ module Rubydium
50
51
  @text_without_command = @text.gsub(@command.to_s, "").gsub(/@#{config.bot_username}\b/,
51
52
  "").strip
52
53
  @text_without_bot_mentions = @text.gsub(/@#{config.bot_username}\b/, "")
53
- @topic_id = @msg.message_thread_id if @chat.is_forum
54
54
  end
55
55
 
56
56
  def handle_update
@@ -12,6 +12,8 @@ module Rubydium
12
12
  end
13
13
 
14
14
  def definitely_message(maybe_message)
15
+ return maybe_message if maybe_message.is_a? Telegram::Bot::Types::Message
16
+
15
17
  if maybe_message["message_id"]
16
18
  Telegram::Bot::Types::Message.new(maybe_message)
17
19
  elsif maybe_message["result"]["message_id"]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rubydium
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.2"
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.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - bulgakke