telegram-support-bot 0.1.04 → 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: 7136195dca0f9287a9534c5ef4004610d897a4b1033e5a45505826e472c927d8
4
- data.tar.gz: 80556619e8db83f143d445df3ffb033d3f72838bb5bb69d4182c8379c441e522
3
+ metadata.gz: 443be16da398a9055e09a98aa7a828d887baa3828916f0afa2a509e9e228d1a3
4
+ data.tar.gz: 959d8dbe4eaeb3660bd688dafa26712575af0b0269d94acbea1e294ce9901af9
5
5
  SHA512:
6
- metadata.gz: d40c42dcca1f66a0a3c9fb9d563371699969a26a58d6719b49097c53f645aec5af86c5d1794a04d8e69cb0f90bb4e46cfeab8b3f1e2d74137c4dd0701b7e2350
7
- data.tar.gz: 2c5b4fd82fa459cb6f8aed6004af0f7f2fff1a7958b32e3f947b7be45a965b5d445a5a00b52c94c2a37887b91208fee213522c48146d690b590eb9bcf437de59
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.04"
4
+ VERSION = "0.1.06"
5
5
  end
@@ -48,7 +48,6 @@ module TelegramSupportBot
48
48
 
49
49
  def process_message(message)
50
50
  @message_chat_id = message['chat']['id']
51
- ap message
52
51
 
53
52
  if message_chat_id == configuration.support_chat_id
54
53
  process_support_chat_message(message)
@@ -93,8 +92,10 @@ module TelegramSupportBot
93
92
  send_welcome_message(chat_id: message_chat_id)
94
93
  else
95
94
  # Respond to 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)
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
98
99
  end
99
100
  end
100
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.04
4
+ version: 0.1.06
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Buslaev