telegram-support-bot 0.1.05 → 0.1.06

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: dcea4ac0a04b533cab630e3964201270b87c7d3acf458b17b655ca0187b39ba1
4
- data.tar.gz: b459f4336cb5315517454c28a9e87303e48d1dbb2a56dfde081b77eb65bb12dd
3
+ metadata.gz: 443be16da398a9055e09a98aa7a828d887baa3828916f0afa2a509e9e228d1a3
4
+ data.tar.gz: 959d8dbe4eaeb3660bd688dafa26712575af0b0269d94acbea1e294ce9901af9
5
5
  SHA512:
6
- metadata.gz: 15812bc0e256c828d514d92a4c115b34b3f4e3f202fc327a77299fe94a24f451ca2764c06e0edfc8b2187a7c176d5bbcc2ca70b2ea9a74ed33940d75013ec3de
7
- data.tar.gz: 0e82ae4ec0c240844d7dc4eb4a85a9642e865f7fce8b08cc57532098949e2a6e09130a1a8a27b1fd2826437a2bdeffd4f4432cca99c33547b3fd1bdfd0d67429
6
+ metadata.gz: adfa333fb11bd3f68551a68a7b25f17d09a3840c5326ae65a0872741c326c7956e9d7ccdfe74f33d2e7f017f8e307f9fccd804a744df81004a05a6b460da0f7a
7
+ data.tar.gz: 75a42d5e219572496a5d3011a1c66373878a1cba685fbf7ff8574e9a00b451002df6b082f998e6d6be77c7b3dd8972d9d9e7faaaa3c486c83feece51724c8294
@@ -3,14 +3,15 @@
3
3
  module TelegramSupportBot
4
4
  class Configuration
5
5
  attr_accessor :adapter, :adapter_options, :support_chat_id, :welcome_message,
6
- :auto_away_message, :auto_away_interval
6
+ :auto_away_message, :auto_away_interval, :ignore_unknown_commands
7
7
 
8
8
  def initialize
9
- @adapter = :telegram_bot
10
- @adapter_options = {}
11
- @welcome_message = 'Welcome! How can we help you?'
12
- @auto_away_interval = 10 # seconds
13
- @auto_away_message = 'We are sorry, all operators are busy at the moment. Please wait'
9
+ @adapter = :telegram_bot
10
+ @adapter_options = {}
11
+ @welcome_message = 'Welcome! How can we help you?'
12
+ @ignore_unknown_commands = true
13
+ @auto_away_interval = 10 # seconds
14
+ @auto_away_message = 'We are sorry, all operators are busy at the moment. Please wait'
14
15
  end
15
16
  end
16
17
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TelegramSupportBot
4
- VERSION = "0.1.05"
4
+ VERSION = "0.1.06"
5
5
  end
@@ -92,8 +92,10 @@ module TelegramSupportBot
92
92
  send_welcome_message(chat_id: message_chat_id)
93
93
  else
94
94
  # Respond to unknown commands
95
- unknown_command_response = "I don't know the command #{command}. Please use /start to begin or check the available commands."
96
- adapter.send_message(chat_id: message_chat_id, text: unknown_command_response)
95
+ unless configuration.ignore_unknown_commands
96
+ unknown_command_response = "I don't know the command #{command}. Please use /start to begin or check the available commands."
97
+ adapter.send_message(chat_id: message_chat_id, text: unknown_command_response)
98
+ end
97
99
  end
98
100
  end
99
101
 
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.05
4
+ version: 0.1.06
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Buslaev