Replies: 2 comments 1 reply
-
On top of that, if you only match on "Got character ZDOID from" you will get your message too each time someone dies. |
Beta Was this translation helpful? Give feedback.
-
I did something a little different using a python script. Using Docker compose add these to start up:
playerconnected.py file:
This watches for the 'Got handshake' log with the users Steam ID and then calls Steam and gets the xml output of the users profile, gets their name, then posts the connection message with the Steam name to Discord. You need to update the discordhook_url variable in the python script to your webhook URL. |
Beta Was this translation helpful? Give feedback.
-
I have my valheim.env setup and following instructions.
My goal is to have players who join the server, for Discord to notify it in a channel. The webhook is working for this as:
DISCORD_MESSAGE=Starting Valheim Server!
PRE_BOOTSTRAP_HOOK=curl -sfSL -X POST -H "Content-Type: application/json" -d "{"username":"Valheim","content":"$DISCORD_MESSAGE"}" "$DISCORD_WEBHOOK"
In this case, the message goes through saying the server is starting. But when I do this:
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"; }'
I get an error saying the "l" and "msg" variables are empty. Can someone help with this thanks!
Beta Was this translation helpful? Give feedback.
All reactions