rubydium 0.3.0 → 0.3.2
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/lib/rubydium/bot.rb +2 -2
- data/lib/rubydium/mixins/other_actions.rb +2 -0
- 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: '06454492015a165a13f48b512e35f28d01c23d971f2e747a63db539f99a74dba'
|
4
|
+
data.tar.gz: 992290fd34805a84438d848067e2281b13d6542e80671160bbf46f8699cdb353
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
@
|
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"]
|
data/lib/rubydium/version.rb
CHANGED