add thank button

This commit is contained in:
MarkusRost 2024-07-05 21:47:48 +00:00
parent c376d4bcc7
commit ce80e15b36

View file

@ -613,6 +613,11 @@ async def compact_formatter(action, change, parsed_comment, categories, recent_c
else:
content = _("Unknown event `{event}` by [{author}]({author_url}), report it on the [support server](<{support}>).").format(event=action, author=author, author_url=author_url, support=settings["support"])
action = "unknown"
if "thank" in action_buttons and action != "suppressed":
if change["type"] == "log":
message_buttons.append((BUTTON_PREFIX + " thank log " + str(change["logid"]), _("Thank user"), 3, {"id": None, "name": "👍"}))
else:
message_buttons.append((BUTTON_PREFIX + " thank rev " + str(change["revid"]), _("Thank user"), 3, {"id": None, "name": "👍"}))
message = DiscordMessage("compact", action, message_target[1], content=content, wiki=WIKI_SCRIPT_PATH)
for message_button in message_buttons:
message.add_button(*message_button)