-
-
Save LightAxe/8d47a3cf2b81abfb7291e682baa00c15 to your computer and use it in GitHub Desktop.
Slack Webhook bash script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CHANNEL="#general" | |
USERNAME="MyBot" | |
EMOJI=":ghost:" | |
MSG=$* | |
PAYLOAD="payload={\"channel\": \"$CHANNEL\", \"username\": \"$USERNAME\", \"text\": \"$MSG\", \"link_names\": 1, \"icon_emoji\": \"$EMOJI\"}" | |
HOOK=https://hooks.slack.com/services/T00000000/XXXXYYYZ/XXXXXXXX | |
curl -X POST --data-urlencode "$PAYLOAD" "$HOOK" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment