Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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