fix thank button for logs

This commit is contained in:
MarkusRost 2024-07-11 18:57:52 +00:00
parent c96488153c
commit faf3d3d9eb

View file

@ -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":