Daniel Gibbs 4 лет назад
Родитель
Сommit
77e1ee16ac

+ 1 - 1
lgsm/functions/alert_discord.sh

@@ -45,7 +45,7 @@ json=$(cat <<EOF
 				},
 				{
 				"name": "Country",
-				"value": "${country}",
+				"value": "${countryflag} ${country}",
 				"inline": true
 				},
 				{

+ 0 - 1
lgsm/functions/command_test_alert.sh

@@ -12,7 +12,6 @@ fn_firstcommand_set
 
 fn_print_dots "${servername}"
 check.sh
-info_game.sh
 alert="${userinput2}"
 if [ -z "${alert}" ]; then
 	alert="test"

+ 9 - 0
lgsm/functions/info_distro.sh

@@ -256,6 +256,15 @@ if [ -z "${extip}" ]; then
 	ipapijson=$(curl --connect-timeout 10 -s http://ip-api.com/json)
 	extip="$(echo "${ipapijson}" | jq -r .query)"
 	country="$(echo "${ipapijson}" | jq -r .country)"
+
+	if [ ! -f "${datadir}/emoji.json" ];then
+		fn_fetch_file "https://raw.githubusercontent.com/GameServerManagers/unicode-emoji-json/main/data-by-emoji.json" "${datadir}" "emoji.json"
+	fi
+
+	if [ -n "${country}" ]&&[ -f "${datadir}/emoji.json" ];then
+	 countryflag="$(jq -r --arg country "flag $country" 'to_entries[]| {"emoji": .key, "name": .value.name} | select(.name==$country)|.emoji' ${datadir}/emoji.json)"
+ 	fi
+
 	exitcode=$?
 	# Should ifconfig.co return an error will use last known IP.
 	if [ ${exitcode} -eq 0 ]; then