Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save unchama/46c14e5862daed8c585fa39fd0d1bfac to your computer and use it in GitHub Desktop.
Save unchama/46c14e5862daed8c585fa39fd0d1bfac to your computer and use it in GitHub Desktop.
#!/bin/bash
# テキストメッセージを送りつける
WEBHOOKURL="https://discordapp.com/api/webhooks/~~~"
MSG="this is a test string.\\nbunbun hello youtube."
curl $WEBHOOKURL -X POST -H "Content-Type: application/json" -d "{\"content\": \"$MSG\"}"
# ファイルを送りつける
WEBHOOKURL="https://discordapp.com/api/webhooks/~~~"
FILE=/tmp/test.log
curl $WEBHOOKURL -X POST -H "Content-Type: multipart/form-data" -F "file=@$FILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment