Created
July 15, 2023 23:16
-
-
Save ss44/909a3dbdf37fd1b94b77e1cf81fcba51 to your computer and use it in GitHub Desktop.
Bash Function To Ping Discord
This file contains 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 | |
# The following ought to be added to any of the auto loaded bash files ~/.bash_profile or ~/.bash_aliases etc. | |
ping_discord () | |
{ | |
local strDiscordWebhookUrl=<replace with your webhook_url> | |
local strMessage="$@"; | |
curl -i -H "Accept: application/json" \ | |
-H "Content-Type:application/json" \ | |
-X POST --data "{\"content\": \"${strMessage}\"}" \ | |
"${strDiscordWebhookUrl}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment