lloesche / valheim-server-docker

Valheim dedicated gameserver with automatic update, World backup, BepInEx and ValheimPlus mod support
https://hub.docker.com/r/lloesche/valheim-server
Apache License 2.0
1.92k stars 269 forks source link

Player spawn Discord notification doesn't work #696

Open NorskNoobing opened 1 month ago

NorskNoobing commented 1 month ago

I set up the Discord player spawn notification from the log filter using the steps in the readme. I translated it into my composefile, but it doesn't seem to work. No error is logged in the container logs, and I don't get any messages on Discord. I tested the server start notification via Discord, and it worked properly.

Are there any syntax issues? How could I troubleshoot this? Is there another logfile for these types of logs?

Here's how the relevant env-vars look:

environment:
  - DISCORD_WEBHOOK=REDACTED
  - VALHEIM_LOG_FILTER_CONTAINS_Spawned="Got character ZDOID from"
  - 'ON_VALHEIM_LOG_FILTER_CONTAINS_Spawned={ read l; l=$${l//*ZDOID from /}; l=$${l// :*/}; msg="Player $$l spawned into the world"; curl -sfSL -X POST -H "Content-Type: application/json" -d "{\"username\":\"Valheim\",\"content\":\"$$msg\"}" "$$DISCORD_WEBHOOK"; }'