mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-14 19:48:57 +01:00
dispatcher: retrieve Handler class name dynamically
this way it is more resilient to class name changes
This commit is contained in:
parent
02243f6fda
commit
82282ae125
1 changed files with 2 additions and 1 deletions
|
@ -219,7 +219,8 @@ class Dispatcher(object):
|
|||
"""
|
||||
|
||||
if not isinstance(handler, Handler):
|
||||
raise TypeError('Handler is no instance of telegram.ext.Handler')
|
||||
raise TypeError(
|
||||
'handler is not an instance of {0}'.format(Handler.__name__))
|
||||
|
||||
if group not in self.handlers:
|
||||
self.handlers[group] = list()
|
||||
|
|
Loading…
Add table
Reference in a new issue