From f54d340be3dbce14e13aa4744698d6d999d16e6a Mon Sep 17 00:00:00 2001 From: destruc7i0n Date: Fri, 31 Dec 2021 13:13:40 -0500 Subject: cleanup from merge --- src/MinecraftHandler.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/MinecraftHandler.ts') diff --git a/src/MinecraftHandler.ts b/src/MinecraftHandler.ts index 48c30b4..7302c52 100644 --- a/src/MinecraftHandler.ts +++ b/src/MinecraftHandler.ts @@ -111,12 +111,12 @@ class MinecraftHandler { return { username: serverUsername, message: `**${username}** ${rest}` } } } else if (this.config.SHOW_PLAYER_DEATH) { - const death_msg_re = new RegExp(this.config.REGEX_DEATH_MESSAGE) - const death_msg_match = logLine.match(death_msg_re) + const deathMessageRegex = new RegExp(this.config.REGEX_DEATH_MESSAGE ?? '^[\\w_]+ died') + const deathMessageMatch = logLine.match(deathMessageRegex) - if (death_msg_match) { + if (deathMessageMatch) { if (this.config.DEBUG) { - console.log(`[DEBUG] A player died. Matched on "${death_msg_match[1]}"`) + console.log(`[DEBUG] A player died. Matched on "${deathMessageMatch[1]}"`) } return { username: serverUsername, message: logLine } } -- cgit 1.4.1