diff --git a/extensions/hooks/buttons.py b/extensions/hooks/buttons.py index 523f841..9aacce2 100644 --- a/extensions/hooks/buttons.py +++ b/extensions/hooks/buttons.py @@ -66,13 +66,11 @@ def buttons_hook(message: DiscordMessage, metadata: DiscordMessageMetadata, cont if "move" in action_buttons and context.event in ("move/move", "move/move_redir"): add_button(message, BUTTON_PREFIX + " move " + str(change["pageid"]) + " " + change["title"], context.gettext("Move back"), 2, {"id": None, "name": "🔂"}) - if context.event != "edit": - return - if "rollback" in action_buttons: + if "rollback" in action_buttons and context.event == "edit": add_button(message, BUTTON_PREFIX + " rollback " + str(change["pageid"]) + " " + ( "#" + str(change["userid"]) if change["userid"] else change["user"]), context.gettext("Rollback"), 1, {"id": None, "name": "🔁"}) - if "undo" in action_buttons: + if "undo" in action_buttons and context.event == "edit": add_button(message, BUTTON_PREFIX + " undo " + str(change["pageid"]) + " " + str(change["revid"]), context.gettext("Undo"), 2, {"id": None, "name": "🔂"}) if "thank" in action_buttons and context.event != "suppressed":