mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
add block button with disabled talk page
This commit is contained in:
parent
1355f623e1
commit
2737d3d16b
|
@ -25,6 +25,7 @@ from src.configloader import settings
|
||||||
# "hooks": {
|
# "hooks": {
|
||||||
# "buttons": {
|
# "buttons": {
|
||||||
# "block": "Block user",
|
# "block": "Block user",
|
||||||
|
# "blocknotalk": "Block user (disable talk)",
|
||||||
# "delete": "Delete",
|
# "delete": "Delete",
|
||||||
# "filerevert": "Revert",
|
# "filerevert": "Revert",
|
||||||
# "move": "Move back",
|
# "move": "Move back",
|
||||||
|
@ -53,7 +54,12 @@ def buttons_hook(message: DiscordMessage, metadata: DiscordMessageMetadata, cont
|
||||||
if not len(action_buttons) or context.feed_type == "discussion":
|
if not len(action_buttons) or context.feed_type == "discussion":
|
||||||
return
|
return
|
||||||
BUTTON_PREFIX = context.client.WIKI_SCRIPT_PATH[len(context.client.WIKI_JUST_DOMAIN):]
|
BUTTON_PREFIX = context.client.WIKI_SCRIPT_PATH[len(context.client.WIKI_JUST_DOMAIN):]
|
||||||
if "block" in action_buttons and context.event != "suppressed":
|
if context.event != "suppressed":
|
||||||
|
if "blocknotalk" in action_buttons:
|
||||||
|
add_button(message,
|
||||||
|
BUTTON_PREFIX + " blocknotalk " + ("#" + str(change["userid"]) if change["userid"] else change["user"]),
|
||||||
|
action_buttons["blocknotalk"], 4, {"id": None, "name": "🚧"})
|
||||||
|
if "block" in action_buttons:
|
||||||
add_button(message,
|
add_button(message,
|
||||||
BUTTON_PREFIX + " block " + ("#" + str(change["userid"]) if change["userid"] else change["user"]),
|
BUTTON_PREFIX + " block " + ("#" + str(change["userid"]) if change["userid"] else change["user"]),
|
||||||
action_buttons["block"], 4, {"id": None, "name": "🚧"})
|
action_buttons["block"], 4, {"id": None, "name": "🚧"})
|
||||||
|
|
Loading…
Reference in a new issue