Make sure to not add callbacks from buttons= twice

This commit is contained in:
Lonami Exo 2018-07-21 13:24:32 +02:00
parent 24758b82ec
commit 7750c9ff2f

View File

@ -31,6 +31,9 @@ class ButtonMethods(UpdateMethods):
is_normal |= not inline
if isinstance(button, custom.Button):
if button.callback:
self.remove_event_handler(
button.callback, events.CallbackQuery)
self.add_event_handler(
button.callback,
events.CallbackQuery(data=button.data)