Repository: python-telegram-bot/python-telegram-bot

Issue:
commandhandler error after updated the library to the 8.1.0
after i updated the library to 8.1.0  i keep getting this error

```
 ERROR - An uncaught error was raised while processing the update
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/telegram/ext/dispatcher.py", line 269, in process_update
    for handler in (x for x in self.handlers[group] if x.check_update(update)):
  File "/usr/local/lib/python3.5/dist-packages/telegram/ext/dispatcher.py", line 269, in <genexpr>
    for handler in (x for x in self.handlers[group] if x.check_update(update)):
  File "/usr/local/lib/python3.5/dist-packages/telegram/ext/commandhandler.py", line 137, in check_update
    command = message.text[1:].split(None, 1)[0].split('@')
```

i did not change a single line of my code and in fact reverting to the previous version of the library i am fine


edit:


**steps to reproduce:**
- send a text message containing only one word.

it doesn't happen with commands or text containing more than one words or media

edit2:
set the log on DEBUG it also say
`IndexError: list index out of range` in addition to the previous Traceback


Discussion:
i guess the issue could depend on this https://github.com/python-telegram-bot/python-telegram-bot/commit/ec9b16ac7b55ca1f02291d157f06028321b52d79#diff-9cd44b48f0b3c83abd861dfd18b28090R137
@91DarioDev Do you mean one word or one character?
I can confirm that this happens when you only send one character to the bot.

This can be tested with the echobot2.py example.

Resolving patch:
diff --git a/docs/source/conf.py b/docs/source/conf.py
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -60,7 +60,7 @@
 # The short X.Y version.
 version = '8.1'  # telegram.__version__[:3]
 # The full version, including alpha/beta/rc tags.
-release = '8.1.0'  # telegram.__version__
+release = '8.1.1'  # telegram.__version__
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/telegram/ext/commandhandler.py b/telegram/ext/commandhandler.py
--- a/telegram/ext/commandhandler.py
+++ b/telegram/ext/commandhandler.py
@@ -133,7 +133,7 @@ def check_update(self, update):
                 and (update.message or update.edited_message and self.allow_edited)):
             message = update.message or update.edited_message
 
-            if message.text:
+            if message.text and message.text.startswith('/') and len(message.text) > 1:
                 command = message.text[1:].split(None, 1)[0].split('@')
                 command.append(
                     message.bot.username)  # in case the command was send without a username
@@ -145,7 +145,7 @@ def check_update(self, update):
                 else:
                     res = self.filters(message)
 
-                return res and (message.text.startswith('/') and command[0].lower() in self.command
+                return res and (command[0].lower() in self.command
                                 and command[1].lower() == message.bot.username.lower())
             else:
                 return False
diff --git a/telegram/version.py b/telegram/version.py
--- a/telegram/version.py
+++ b/telegram/version.py
@@ -17,4 +17,4 @@
 # You should have received a copy of the GNU Lesser Public License
 # along with this program.  If not, see [http://www.gnu.org/licenses/].
 
-__version__ = '8.1.0'
+__version__ = '8.1.1'


Test patch:
diff --git a/tests/test_commandhandler.py b/tests/test_commandhandler.py
--- a/tests/test_commandhandler.py
+++ b/tests/test_commandhandler.py
@@ -174,6 +174,22 @@ def test_newline(self, dp, message):
         dp.process_update(Update(0, message))
         assert self.test_flag
 
+    def test_single_char(self, dp, message):
+        # Regression test for https://github.com/python-telegram-bot/python-telegram-bot/issues/871
+        handler = CommandHandler('test', self.callback_basic)
+        dp.add_handler(handler)
+
+        message.text = 'a'
+        assert not handler.check_update(Update(0, message))
+
+    def test_single_slash(self, dp, message):
+        # Regression test for https://github.com/python-telegram-bot/python-telegram-bot/issues/871
+        handler = CommandHandler('test', self.callback_basic)
+        dp.add_handler(handler)
+
+        message.text = '/'
+        assert not handler.check_update(Update(0, message))
+
     def test_pass_user_or_chat_data(self, dp, message):
         handler = CommandHandler('test', self.callback_data_1, pass_user_data=True)
         dp.add_handler(handler)