From b67230d13c0ebb40a20cfacd31b14b9176a9ccab Mon Sep 17 00:00:00 2001 From: TaxMachine Date: Mon, 25 Jul 2022 16:19:45 -0400 Subject: [PATCH] amog --- server/index.js | 12 ++++++------ server/package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/server/index.js b/server/index.js index 748dadc..a1fdd92 100644 --- a/server/index.js +++ b/server/index.js @@ -10,7 +10,7 @@ const express = require("express"), db = new sqlite3.Database("./servers.db"); const createWebhook = url => new Discord.Webhook(url).setUsername("TaxenHeimer").setAvatar("https://cdn.discordapp.com/attachments/999167321631363126/999495738943868928/nn.png") -const countrify = e => require("./contrycode.json")[e] +const countrify = e => require("./countrycode.json")[e] const replaceMOTD = e => e.replace(/'/g, "\\'").replace(/-/g, '\\-') const makeEmbed = (mc, neit) => { var Embed = new Discord.MessageBuilder() @@ -18,7 +18,7 @@ const makeEmbed = (mc, neit) => { .setColor("#00ff00") .addField("**Host**", `\`${mc.Server}\``, true) .addField("**Country**", `\`${countrify(mc.ip.country)}\``) - .addField("**Version**", `\`${mc.version.name} (${mc.version.protocol})\``, true) + .addField("**Version**", `\`${mc.version.name}\``, true) .addField("**Players**", `\`${mc.players.online}/${mc.players.max}\``, true) .addField("**Ping**", `\`${mc.roundTripLatency}ms\``, true) .addField("**Motd**", "```\n" + mc.motd.clean + "\n```") @@ -27,7 +27,6 @@ const makeEmbed = (mc, neit) => { .setTimestamp() if (neit) Embed.setText("<@390491795655622657>") - console.log(Embed) return Embed } var webhooks = [ @@ -58,6 +57,7 @@ app.post("/server", async (req, res) => { var Minecraft = await mc.status(Server, 25565, { enableSRV: true }) + fs.appendFileSync(`${__dirname}/ip.txt`, `${Server}\n`) Minecraft.ip = geoIP.lookup(Server) Minecraft.Server = `${Server}:25565` var cleanMOTD = replaceMOTD(Minecraft.motd.clean) @@ -79,7 +79,7 @@ app.post("/server", async (req, res) => { break } switch(true) { - case Minecraft.version.name.includes("1.17"): + case Minecraft.version.name === "1.17": webhooks[2].send(makeEmbed(Minecraft, "neit")) break; default: @@ -91,5 +91,5 @@ app.listen(9000, () => { console.clear() console.log("server ready") }) -//process.on("unhandledRejection", callback => console.log(callback)) -//process.on("uncaughtException", callback => console.log(callback)) \ No newline at end of file +process.on("unhandledRejection", callback => console.log(callback)) +process.on("uncaughtException", callback => console.log(callback)) \ No newline at end of file diff --git a/server/package.json b/server/package.json index a023891..3035770 100644 --- a/server/package.json +++ b/server/package.json @@ -4,7 +4,7 @@ "description": "", "main": "index.js", "scripts": { - "test": "nodemon index", + "test": "nodemon --ignore servers.db index", "compile": "bytenode --compile index.js", "runc": "bytenode index.js" },