telegram-support-bot 0.1.05 → 0.1.06
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 443be16da398a9055e09a98aa7a828d887baa3828916f0afa2a509e9e228d1a3
|
4
|
+
data.tar.gz: 959d8dbe4eaeb3660bd688dafa26712575af0b0269d94acbea1e294ce9901af9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
10
|
-
@adapter_options
|
11
|
-
@welcome_message
|
12
|
-
@
|
13
|
-
@
|
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
|
data/lib/telegram_support_bot.rb
CHANGED
@@ -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
|
-
|
96
|
-
|
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
|
|