mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-22 00:14:10 +00:00
Fix to crashing hook
This commit is contained in:
parent
a0a4cd5352
commit
4ffac4210e
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -9,6 +9,7 @@ lastchange.txt
|
||||||
/venv/
|
/venv/
|
||||||
/lokalize-scripts/
|
/lokalize-scripts/
|
||||||
/venvv/
|
/venvv/
|
||||||
|
/.idea/
|
||||||
__pycache__
|
__pycache__
|
||||||
*.bat
|
*.bat
|
||||||
*.code-workspace
|
*.code-workspace
|
||||||
|
|
|
@ -30,7 +30,7 @@ def example_post_hook(message, metadata, context, change):
|
||||||
if discord_users and change["ns"] in [2, 3, 202] and not "/" in change["title"]:
|
if discord_users and change["ns"] in [2, 3, 202] and not "/" in change["title"]:
|
||||||
username = change["title"].split(':', 1)[1]
|
username = change["title"].split(':', 1)[1]
|
||||||
if discord_users.get(username, "") and username != change["user"]:
|
if discord_users.get(username, "") and username != change["user"]:
|
||||||
message.webhook_object["content"] = (content or "") + " <@{}>".format(discord_users[username])
|
message.webhook_object["content"] = (message.webhook_object.get("content", "") or "") + " <@{}>".format(discord_users[username])
|
||||||
if message.webhook_object["allowed_mentions"].get("users", []):
|
if message.webhook_object["allowed_mentions"].get("users", []):
|
||||||
message.webhook_object["allowed_mentions"]["users"].append(discord_users[username])
|
message.webhook_object["allowed_mentions"]["users"].append(discord_users[username])
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue