Created
November 6, 2017 19:42
-
-
Save gamersalpha/11179b34cddde5434e3713f73603b699 to your computer and use it in GitHub Desktop.
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 | |
# LinuxGSM alert_discord.sh function | |
# Author: Daniel Gibbs | |
# Contributor: faflfama | |
# Website: https://gameservermanagers.com | |
# Description: Sends Discord alert. | |
json=$(cat <<EOF | |
{ | |
"username":"LinuxGSM", | |
"avatar_url":"https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/images/logo/lgsm-dark-square-512.png", | |
"file":"content", | |
"embeds": [{ | |
"color": "2067276", | |
"author": {"name": "Hello World", "icon_url": "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/images/logo/lgsm-dark-square-512.png"}, | |
"title": "", | |
"description": "", | |
"url": "", | |
"type": "content", | |
"thumbnail": {"url": "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/images/logo/lgsm-dark-square-512.png"}, | |
"footer": {"text": "LinuxGSM", "icon_url": "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/images/logo/lgsm-dark-square-512.png"}, | |
"fields": [ | |
{ | |
"name": "Alert Message", | |
"value": "This is Alert Message" | |
}, | |
{ | |
"name": "Game", | |
"value": "this is u game !!" | |
}, | |
{ | |
"name": "Server name", | |
"value": "This is u server" | |
}, | |
{ | |
"name": "Hostname", | |
"value": "This is My Hostname" | |
}, | |
{ | |
"name": "Server IP", | |
"value": "And this is my IP" | |
}, | |
{ | |
"name": "More info", | |
"value": "i can give u more information ?" | |
} | |
] | |
}] | |
} | |
EOF | |
) | |
discordwebhook="https://discordapp.com/api/webhooks/XXXXXXX" | |
discordsend=$(curl -sSL -H "Content-Type: application/json" -X POST -d """${json}""" ${discordwebhook}) | |
echo ${json} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment