Skip to content

Commit

Permalink
Fix: send a valid user-agent when making Discord webhook calls
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueBrain committed Mar 9, 2024
1 parent 370d55c commit c051a78
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/GitHub/protocols/discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit c051a78

Please sign in to comment.