diff options
author | destruc7i0n <destruc7i0n@users.noreply.github.com> | 2021-12-31 13:13:40 -0500 |
---|---|---|
committer | destruc7i0n <destruc7i0n@users.noreply.github.com> | 2021-12-31 13:13:40 -0500 |
commit | f54d340be3dbce14e13aa4744698d6d999d16e6a (patch) | |
tree | c18fe44746321694728ce279364ace6226e26034 | |
parent | Merge branch 'MageLuingil-death-message-regex' (diff) | |
download | shulker-f54d340be3dbce14e13aa4744698d6d999d16e6a.tar.gz shulker-f54d340be3dbce14e13aa4744698d6d999d16e6a.zip |
cleanup from merge
Diffstat (limited to '')
-rw-r--r-- | src/MinecraftHandler.ts | 8 | ||||
-rw-r--r-- | src/Shulker.ts | 4 |
2 files changed, 6 insertions, 6 deletions
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 } } diff --git a/src/Shulker.ts b/src/Shulker.ts index 517d1e2..1846def 100644 --- a/src/Shulker.ts +++ b/src/Shulker.ts @@ -10,7 +10,7 @@ class Shulker { discordClient: DiscordClient handler: Handler - readonly deprecatedConfigs: string[] = ['DEATH_KEY_WORDS']; + readonly deprecatedConfigs: string[] = ['DEATH_KEY_WORDS'] constructor() { } @@ -30,7 +30,7 @@ class Shulker { return false } - for (let option of this.deprecatedConfigs) { + for (const option of this.deprecatedConfigs) { if (this.config.hasOwnProperty(option)) { console.log('[WARN] Using deprecated config option ' + option + '. Check README.md for current options.') } |