Skip to content

Commit

Permalink
feat: add server URL to alert message
Browse files Browse the repository at this point in the history
Added a new feature that includes the server URL in the alert message. The server URL is now displayed as a clickable link in the Discord alert, allowing users to easily connect to the server.
  • Loading branch information
dgibbs64 committed Oct 15, 2023
1 parent 00a6b22 commit 5027254
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lgsm/modules/alert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ fn_alert_info() {
# Images
alerticon="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/gameicons/${shortname}-icon.png"

# Server URL
if [ -n "${appid}" ]; then
serverurl="steam://connect/${alertip}:${port}"
fi

if [ "${alert}" == "permissions" ]; then
fn_alert_permissions
elif [ "${alert}" == "monitor-session" ]; then
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/alert_discord.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jsonshortnoinfo=$(
},
{
"name": "Server IP",
"value": "${alertip}:${port}",
"value": "[${alertip}:${port}](${serverurl})",
"inline": true
},
{
Expand Down

0 comments on commit 5027254

Please sign in to comment.