Closed arevak closed 3 years ago
Odin source is in this repo under sec, that event message gets put into content. Are you on the latest dev image for discord notifications? 0.o that's the same image I am using now to run the release notifications.
Try putting quotes around your broadcast message
I did a docker pull like a day or two ago., How do I know whether im on the latest dev image? Is the image id useful?
So to test I did the following:
docker-compose exec --user steam valheim bash
DEBUG_MODE=1 odin notify -r test
docker-compose.yml
version: "3"
services:
valheim:
image: mbround18/valheim:latest
ports:
- 2456:2456/udp
- 2457:2457/udp
- 2458:2458/udp
environment:
- PORT=2456
- NAME="*****"
- WORLD="Dedicated"
- PASSWORD="*******"
- TZ=America/Los_Angeles
- PUBLIC=0
- AUTO_UPDATE=1
- AUTO_UPDATE_SCHEDULE="0 4 * * *"
- WEBHOOK_URL="https://discordapp.com/api/webhooks/*****/******"
- UPDATE_ON_STARTUP=1
volumes:
- ./valheim/saves:/home/steam/.config/unity3d/IronGate/Valheim
- ./valheim/server:/home/steam/valheim
steam@c6411a638b4e:~/valheim$ DEBUG_MODE=1 odin notify -r test
[ODIN][DEBUG] - Debugging set to true
[ODIN][DEBUG] - Debug mode enabled!
[ODIN][DEBUG] - Launching notify command...
[ODIN][DEBUG] - Checking env for MESSAGE
[ODIN][DEBUG] - Checking env for webhook_url
[ODIN][DEBUG] - Env variable found webhook_url="https://discordapp.com/api/webhooks/****/*****"
[ODIN][INFO] - Sending Broadcast: test
[ODIN][DEBUG] - Webhook enabled, sending notification Broadcast
[ODIN][DEBUG] - Webhook URL: "https://discordapp.com/api/webhooks/****/****"
[ODIN][DEBUG] - Webhook Payload: {"event_type":{"name":"Broadcast","status":"Triggered"},"event_message":"test","timestamp":"2021-02-28T21:25:55.470995900-08:00"}
[ODIN][ERROR] - [Broadcast]: Error with webhook! Status 500
Filtered out sensitive crap with ***
Sorry also taking the same webhook API, throwing it into postman and posting the same payload gets the same response. Editing the payload to have content instead of event_message works just fine.
Are there maybe multiple ways to enable the webhook? Some extra step I'm missing maybe? I googled around a bit and wasnt able to find the api docs that reference this type of usage of the webhook.
It should not be using the payload you see there, good find! Ill take a look at it
There was a recent change to support the discordapp base too. I think it's just an outdated image
Totally right, updated the image and it worked like a charm! Bang up job guys
Odin notify is generating messages like this:
and responds with
I think it needs to be
content
instead ofevent_message
Not too familiar with rust or I'd submit a PR and I don't know where the odin source is