mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Merge remote-tracking branch 'origin/testing' into testing
This commit is contained in:
commit
65b9a51333
|
@ -29,6 +29,7 @@ from src.configloader import settings
|
||||||
# "filerevert": "Revert",
|
# "filerevert": "Revert",
|
||||||
# "move": "Move back",
|
# "move": "Move back",
|
||||||
# "rollback": "Rollback",
|
# "rollback": "Rollback",
|
||||||
|
# "thank": "Thank user",
|
||||||
# "undo": "Undo"
|
# "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"):
|
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"],
|
add_button(message, BUTTON_PREFIX + " move " + str(change["pageid"]) + " " + change["title"],
|
||||||
action_buttons["move"], 2, {"id": None, "name": "🔂"})
|
action_buttons["move"], 2, {"id": None, "name": "🔂"})
|
||||||
if context.event != "edit":
|
if "rollback" in action_buttons and context.event == "edit":
|
||||||
return
|
|
||||||
if "rollback" in action_buttons:
|
|
||||||
add_button(message, BUTTON_PREFIX + " rollback " + str(change["pageid"]) + " " + (
|
add_button(message, BUTTON_PREFIX + " rollback " + str(change["pageid"]) + " " + (
|
||||||
"#" + str(change["userid"]) if change["userid"] else change["user"]),
|
"#" + str(change["userid"]) if change["userid"] else change["user"]),
|
||||||
action_buttons["rollback"], 1, {"id": None, "name": "🔁"})
|
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"]),
|
add_button(message, BUTTON_PREFIX + " undo " + str(change["pageid"]) + " " + str(change["revid"]),
|
||||||
action_buttons["undo"], 2, {"id": None, "name": "🔂"})
|
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": "👍"})
|
||||||
|
|
Loading…
Reference in a new issue