From 1f83e7ae4ee42dcee099c1563874b501e2510cc9 Mon Sep 17 00:00:00 2001 From: Noam Meltzer Date: Mon, 25 Apr 2016 10:44:55 +0300 Subject: [PATCH] dispatcher.addHandler(): validate value of group is int --- telegram/ext/dispatcher.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/telegram/ext/dispatcher.py b/telegram/ext/dispatcher.py index 5b21abfec..a381d20c9 100644 --- a/telegram/ext/dispatcher.py +++ b/telegram/ext/dispatcher.py @@ -220,6 +220,8 @@ class Dispatcher(object): if not isinstance(handler, Handler): raise TypeError( 'handler is not an instance of {0}'.format(Handler.__name__)) + if not isinstance(group, int): + raise TypeError('group is not int') if group not in self.handlers: self.handlers[group] = list()