Skip to content

Instantly share code, notes, and snippets.

@jD91mZM2
Last active August 16, 2017 03:38
Show Gist options
  • Save jD91mZM2/220ecb8666159d448d9493c1430bebaf to your computer and use it in GitHub Desktop.
Save jD91mZM2/220ecb8666159d448d9493c1430bebaf to your computer and use it in GitHub Desktop.
Use a Discord webhook.
#!/bin/bash
echo -n "URL: "
read url
echo -n "Username: "
read name
echo -n "Image URL: "
read image
echo "Type 'end' to end the content. E.g:"
echo "test"
echo "end"
echo
echo "Content:"
content=""
first="true"
while true; do
read line
if [ "$line" == "end" ]; then
break
fi
if [ "$first" == "true" ]; then
first="false"
else
content="$content"$'\n'
fi
content="$content$line"
done
curl "$url" --data-urlencode "content=$content" --data-urlencode "avatar_url=$image" --data-urlencode "username=$name"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment