From 2e5dc546d7a6969a5ab73716ba56862a8bf80b68 Mon Sep 17 00:00:00 2001 From: Dennis Heinrich Date: Tue, 26 Nov 2024 00:01:52 +0100 Subject: [PATCH] Show no server password when none is given --- source/Services/DiscordEmbed.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/Services/DiscordEmbed.ts b/source/Services/DiscordEmbed.ts index 8d1629e..b479c7d 100644 --- a/source/Services/DiscordEmbed.ts +++ b/source/Services/DiscordEmbed.ts @@ -117,10 +117,15 @@ export default class DiscordEmbed { playerListString = serverStats.getPlayerList().map(p => p.username).join(', '); } + let serverPassword = config.application.serverPassword; + if(config.application.serverPassword == "") { + serverPassword = "-/-"; + } + // @ts-ignore embed.addFields( {name: config.translation.discordEmbed.titleServerName, value: serverStats.getServerName()}, - {name: config.translation.discordEmbed.titleServerPassword, value: config.application.serverPassword}, + {name: config.translation.discordEmbed.titleServerPassword, value: serverPassword}, {name: config.translation.discordEmbed.titleServerTime, value: serverStats.getServerTime()}, { name: `${config.translation.discordEmbed.titlePlayerCount} (${serverStats.getPlayerCount()}/${serverStats.getMaxPlayerCount()}):`,