telegram-support-bot 0.1.08 → 0.1.09

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: d522d11e8602df8c2e6ab13df25de60eb2a376bb4983299092b277ad8ca81c15
4
- data.tar.gz: 99739fa0654123c2b2052f9cdd09c78e2336c7cf1bfc4ac45983486e69a47c40
3
+ metadata.gz: 15900469360f291d85f69a938dc8f25cc9826ec0fab4105c954e0f58aea48868
4
+ data.tar.gz: 441423cab220f879327d6474bafb069c8fa099966f7cc45c6ac2896944a52238
5
5
  SHA512:
6
- metadata.gz: 799182e98806ac1d0e550a89f37f81d867879b00221bf919f1c3665f20d3bb3a6e0c092dad0c1717d1dce3bc0aa10869be56589b7478e967c58a9dea40885018
7
- data.tar.gz: f39e7efa2db2221af245b8641477a03936aa0ef285bcaf40cc21d3de79ece871fbc79c03321aef58602afbf701133b42b310279968f8cb6d07a0768a4de80388
6
+ metadata.gz: 5fa0913384b4a0ecc87dd7c37cc546fc6d8a5e937c9154b7bdeb91d80ed3070cb33d4f5bc6d9d051fe5d84b865bfc904638528e7259cb4a366f5e978e448ecf3
7
+ data.tar.gz: c844cfaf107d7bed62378b7dfd170d28ee8a4e81f17802c7924cc8629a0dc3485242b5966dbc0371bdddffa2bbd5e861068e0970ebb5d5561c7da1b3a663b06d
data/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [Unreleased]
6
+
7
+ ## [0.1.09] - 2026-02-13
8
+
9
+ ### Added
10
+ - Configurable support-chat non-command behavior:
11
+ `ignore_non_command_messages` (default `true`) and
12
+ `non_command_message_response` for optional acknowledgement text.
13
+
5
14
  ## [0.1.08] - 2026-02-13
6
15
 
7
16
  ### Added
data/README.md CHANGED
@@ -43,6 +43,11 @@ TelegramSupportBot.configure do |config|
43
43
  config.adapter_options = { token: 'YOUR_TELEGRAM_BOT_TOKEN' }
44
44
  config.support_chat_id = 'YOUR_SUPPORT_CHAT_ID'
45
45
  config.welcome_message = 'Hi! How can we help you?'
46
+ # Support-chat noise control:
47
+ # true (default) -> ignore non-command messages in support chat
48
+ # false -> reply with non_command_message_response
49
+ config.ignore_non_command_messages = true
50
+ config.non_command_message_response = 'I only respond to commands. Please use /start.'
46
51
  # Optional: ask users to share their phone once for account lookup.
47
52
  config.request_contact_on_start = true
48
53
  # Optional: block forwarding until contact is shared.
@@ -4,6 +4,7 @@ module TelegramSupportBot
4
4
  class Configuration
5
5
  attr_accessor :adapter, :adapter_options, :support_chat_id, :welcome_message,
6
6
  :auto_away_message, :auto_away_interval, :ignore_unknown_commands,
7
+ :ignore_non_command_messages, :non_command_message_response,
7
8
  :request_contact_on_start, :require_contact_for_support, :contact_request_message,
8
9
  :contact_received_message, :contact_invalid_message, :on_contact_received,
9
10
  :state_store, :state_store_options, :mapping_ttl_seconds,
@@ -14,6 +15,8 @@ module TelegramSupportBot
14
15
  @adapter_options = {}
15
16
  @welcome_message = 'Welcome! How can we help you?'
16
17
  @ignore_unknown_commands = true
18
+ @ignore_non_command_messages = true
19
+ @non_command_message_response = 'I received your message, but I only respond to commands. Please use /start to get started.'
17
20
  @auto_away_interval = 10 # seconds
18
21
  @auto_away_message = 'We are sorry, all operators are busy at the moment. Please wait'
19
22
  @request_contact_on_start = false
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TelegramSupportBot
4
- VERSION = "0.1.08"
4
+ VERSION = "0.1.09"
5
5
  end
@@ -130,17 +130,14 @@ module TelegramSupportBot
130
130
  elsif message['text']&.start_with?('/')
131
131
  process_command(message, chat_id: chat_id)
132
132
  else
133
- # For non-command messages, you might want to handle differently or just ignore
134
- # For now, let's just acknowledge the message
135
- acknowledge_non_command_message(message, chat_id: chat_id)
133
+ acknowledge_non_command_message(message, chat_id: chat_id) unless configuration.ignore_non_command_messages
136
134
  end
137
135
  end
138
136
 
139
137
  def acknowledge_non_command_message(message, chat_id:)
140
- reply_message = 'I received your message, but I only respond to commands. Please use /start to get started.'
141
138
  adapter.send_message(
142
139
  chat_id: chat_id,
143
- text: reply_message,
140
+ text: configuration.non_command_message_response,
144
141
  reply_to_message_id: message['message_id']
145
142
  )
146
143
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telegram-support-bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.08
4
+ version: 0.1.09
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Buslaev