diff options
author | destruc7i0n <6181960+destruc7i0n@users.noreply.github.com> | 2020-10-29 10:12:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-29 10:12:58 -0400 |
commit | 3b77b2c587f256af95bbfb6dede821811b6dd77d (patch) | |
tree | 402c56822874762aa1d07857655f9acffc56e4be /src/MinecraftHandler.ts | |
parent | Merge pull request #63 from surepy/master (diff) | |
parent | Add option to output server status into discord (diff) | |
download | shulker-3b77b2c587f256af95bbfb6dede821811b6dd77d.tar.gz shulker-3b77b2c587f256af95bbfb6dede821811b6dd77d.zip |
Merge pull request #64 from Elveskevtar/master
Add option to output server status into discord
Diffstat (limited to '')
-rw-r--r-- | src/MinecraftHandler.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/MinecraftHandler.ts b/src/MinecraftHandler.ts index 7a81718..d9d30d6 100644 --- a/src/MinecraftHandler.ts +++ b/src/MinecraftHandler.ts @@ -88,6 +88,16 @@ class MinecraftHandler { } return { username: serverUsername, message: logLine } + } else if (this.config.SHOW_SERVER_STATUS && (logLine.includes('Starting minecraft server'))) { + if (this.config.DEBUG) { + console.log('[DEBUG]: Server has started') + } + return { username: serverUsername, message: "Server is online" } + } else if (this.config.SHOW_SERVER_STATUS && (logLine.includes('Stopping the server'))) { + if (this.config.DEBUG) { + console.log('[DEBUG]: Server has stopped') + } + return { username: serverUsername, message: "Server is offline" } } else if (this.config.SHOW_PLAYER_ADVANCEMENT && logLine.includes('made the advancement')) { // handle advancements if (this.config.DEBUG){ |