mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-22 15:17:00 +01:00
dispatcher: on removeHandle(), remove the groups too if it's empty
This commit is contained in:
parent
4ac8f86156
commit
78d1faa21e
1 changed files with 3 additions and 0 deletions
|
@ -238,6 +238,9 @@ class Dispatcher(object):
|
|||
"""
|
||||
if handler in self.handlers[group]:
|
||||
self.handlers[group].remove(handler)
|
||||
if not self.handlers[group]:
|
||||
del self.handlers[group]
|
||||
self.groups.remove(group)
|
||||
|
||||
def addErrorHandler(self, callback):
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue