dispatcher: retrieve Handler class name dynamically

this way it is more resilient to class name changes
This commit is contained in:
Noam Meltzer 2016-04-25 09:54:05 +03:00
parent 02243f6fda
commit 82282ae125

View file

@ -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()