mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-26 08:32:58 +01:00
Merge pull request #201 from shelomentsevd/master
Dispather command processing fix(#200).
This commit is contained in:
commit
9637a8748c
2 changed files with 3 additions and 2 deletions
|
@ -23,6 +23,7 @@ The following wonderful people contributed directly or indirectly to this projec
|
||||||
- `Noam Meltzer <https://github.com/tsnoam>`_
|
- `Noam Meltzer <https://github.com/tsnoam>`_
|
||||||
- `Oleg Shlyazhko <https://github.com/ollmer>`_
|
- `Oleg Shlyazhko <https://github.com/ollmer>`_
|
||||||
- `Rahiel Kasim <https://github.com/rahiel>`_
|
- `Rahiel Kasim <https://github.com/rahiel>`_
|
||||||
|
- `Shelomentsev D <https://github.com/shelomentsevd>`_
|
||||||
- `sooyhwang <https://github.com/sooyhwang>`_
|
- `sooyhwang <https://github.com/sooyhwang>`_
|
||||||
- `wjt <https://github.com/wjt>`_
|
- `wjt <https://github.com/wjt>`_
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ import logging
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from inspect import getargspec
|
from inspect import getargspec
|
||||||
from threading import Thread, BoundedSemaphore, Lock, Event, current_thread
|
from threading import Thread, BoundedSemaphore, Lock, Event, current_thread
|
||||||
from re import match
|
from re import match, split
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
from telegram import (TelegramError, Update, NullHandler)
|
from telegram import (TelegramError, Update, NullHandler)
|
||||||
|
@ -548,7 +548,7 @@ class Dispatcher:
|
||||||
command
|
command
|
||||||
"""
|
"""
|
||||||
|
|
||||||
command = update.message.text.split(' ')[0][1:].split('@')[0]
|
command = split('\W', update.message.text[1:])[0]
|
||||||
|
|
||||||
if command in self.telegram_command_handlers:
|
if command in self.telegram_command_handlers:
|
||||||
self.dispatchTo(self.telegram_command_handlers[command], update,
|
self.dispatchTo(self.telegram_command_handlers[command], update,
|
||||||
|
|
Loading…
Add table
Reference in a new issue