diff --git a/extensions/hooks/buttons.py b/extensions/hooks/buttons.py index 8289453..523f841 100644 --- a/extensions/hooks/buttons.py +++ b/extensions/hooks/buttons.py @@ -75,3 +75,10 @@ def buttons_hook(message: DiscordMessage, metadata: DiscordMessageMetadata, cont if "undo" in action_buttons: 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": + if change["type"] == "log": + add_button(message, BUTTON_PREFIX + " thank log " + str(change["logid"]), + context.gettext("Thank user"), 3, {"id": None, "name": "👍"}) + else: + add_button(message, BUTTON_PREFIX + " thank rev " + str(change["revid"]), + context.gettext("Thank user"), 3, {"id": None, "name": "👍"})