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 post to Discord some complex messages #1241

Open
auanasgheps opened this issue Nov 19, 2024 · 2 comments
Open

Cannot post to Discord some complex messages #1241

auanasgheps opened this issue Nov 19, 2024 · 2 comments
Labels

Comments

@auanasgheps
Copy link

📣 Notification Service(s) Impacted
Discord

🐞 Describe the bug
I'm unable to post some messages to Discord. It seems that it gets crazy when complex text/characters are posted, and Apprise throws Bad Request - Unsupported Parameters., error=400.

I own a shell script that manages SnapRAID operations and I just started integrating it with Apprise.
This issue is present only with a specific output that I'm trying to post to Discord. I'm sure it's something to do with escaping, but I don't know much about this topic.
However, the same exact output can be posted to Telegram with no issues.

I've attacched a very dumb test script to replicate the issue but you need SnapRAID installed.

#!/bin/bash
function main(){

function show_snapraid_info() {
  local command_output=$($1)
  echo "$2"
  echo "\`\`\`"
  echo "$command_output"
  echo "\`\`\`"
  INFO_MESSAGE="$2 - \`\`\`$command_output\`\`\`"
  }


APPRISE_URL="discord://<webhook url>"

# Run info command
show_snapraid_info "snapraid status" "### SnapRAID Status"


# Send the message via Apprise to Discord
apprise -vvv -b "Test" -b "$INFO_MESSAGE" "$APPRISE_URL"?format=markdown
}

main

I've attached the command ouput because GitHub isn't able to format it properly
apprise script output.txt

💡 Screenshots and Logs

The same output successfully posted to Telegram by only chaning the URL

immagine

💻 Your System Details:

  • OS: Debian 11
  • Python Version: Python 3.11.2
  • Apprise 1.9.0 installed via pipx

🔮 Additional context
Simpler messages can be posted to Discord, no problem.

@caronc
Copy link
Owner

caronc commented Nov 20, 2024

I notice you're trying to push the content as markdown (in the Apprise URL you used) the table as you share it is very broken Markdown, so it makes sense that maybe this is why the Discord server is rejecting your message.

what happens if you do something like: ?format=text instead?

Does it work then?

@auanasgheps
Copy link
Author

If i disable the markdown command, it works:

immagine

Same if I add "?format=text" but I believe it's the default option.

How should I tackle such scenario?

Telegram just works fine and formats markdown properly. I tried local markdown formatting before sending the message but doesn't work well.

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

No branches or pull requests

2 participants