Merge remote-tracking branch 'origin/testing' into testing

This commit is contained in:
Frisk 2024-08-08 22:49:51 +02:00
commit 65b9a51333

View file

@ -29,6 +29,7 @@ from src.configloader import settings
# "filerevert": "Revert",
# "move": "Move back",
# "rollback": "Rollback",
# "thank": "Thank user",
# "undo": "Undo"
# }
# }
@ -67,12 +68,17 @@ 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"],
action_buttons["move"], 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"]),
action_buttons["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"]),
action_buttons["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"]),
action_buttons["thank"], 3, {"id": None, "name": "👍"})
else:
add_button(message, BUTTON_PREFIX + " thank rev " + str(change["revid"]),
action_buttons["thank"], 3, {"id": None, "name": "👍"})