From c051a786b106edf1b657426fab757843eec559e1 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sat, 9 Mar 2024 14:03:03 +0100 Subject: [PATCH] Fix: send a valid user-agent when making Discord webhook calls --- plugins/GitHub/protocols/discord.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/GitHub/protocols/discord.py b/plugins/GitHub/protocols/discord.py index 81accc6..36dba25 100644 --- a/plugins/GitHub/protocols/discord.py +++ b/plugins/GitHub/protocols/discord.py @@ -24,9 +24,12 @@ async def _send_messages(hook_urls, user, avatar_url, message): "parse": [], }, }, + headers={ + "User-Agent": "DorpsGek (https://github.com/OpenTTD/DorpsGek, 1.0)" + }, ) if resp.status not in (200, 204): - log.error(f"Failed to send message to Discord: {resp.status}") + log.exception(f"Failed to send message to Discord: {resp.status}") @protocols.register("discord", "pull-request")