From 7750c9ff2f1e09083d6c11600143b8a825ae1b70 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sat, 21 Jul 2018 13:24:32 +0200 Subject: [PATCH] Make sure to not add callbacks from buttons= twice --- telethon/client/buttons.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/telethon/client/buttons.py b/telethon/client/buttons.py index 7e64c164..210c17f5 100644 --- a/telethon/client/buttons.py +++ b/telethon/client/buttons.py @@ -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)