Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot send notifications through discord with json #422

Open
hoangdangtrungvn opened this issue Dec 13, 2023 · 3 comments
Open

Cannot send notifications through discord with json #422

hoangdangtrungvn opened this issue Dec 13, 2023 · 3 comments

Comments

@hoangdangtrungvn
Copy link

I config Discord service with url:
WATCHTOWER_NOTIFICATION_URL: "discord://${DISCORD_WEBHOOK_TOKEN}@${DISCORD_WEBHOOK_ID}?json=true"

Then I got this error:
level=error msg="Failed to send shoutrrr notification" error="failed to send discord notification: response status code 400 Bad Request" index=0 notify=no service=discord

But if I remove ?json=true from the URL, the notification is successfully sent to the Discord channel.

I tried replacing json=true with splitlines=false, and it worked fine.

It seems that some query parameters are not functioning correctly.

@piksel
Copy link
Member

piksel commented Dec 13, 2023

The json argument means that it should directly send the template output to the API (which then needs to be correct JSON). What is it you want to accomplish?

@hoangdangtrungvn
Copy link
Author

Screenshot from 2023-12-14 14-17-58

I want to display like last message in the image.

@piksel
Copy link
Member

piksel commented Dec 14, 2023

Try adding ``` around the messages in the watchtower template. You can probably get it to work using the json param and a carefully crafted template according to the discord docs, but it seems like a lot of work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants