From f1d47c730f08bce6bb970d1eaf44e2caf19c4d71 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Sun, 13 Feb 2022 16:33:21 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D1=91=D0=BD=20Sentry?= =?UTF-8?q?=20(=D0=BD=D0=B5=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7?= =?UTF-8?q?=D1=83=D0=B5=D1=82=D1=81=D1=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/General/minecraft.js | 7 +++---- config.sample.js | 4 +--- index.js | 16 +--------------- package.json | 1 - scripts/verify-config.js | 16 ---------------- 5 files changed, 5 insertions(+), 39 deletions(-) diff --git a/commands/General/minecraft.js b/commands/General/minecraft.js index 8bb517c2..bbad5f80 100644 --- a/commands/General/minecraft.js +++ b/commands/General/minecraft.js @@ -1,8 +1,7 @@ const Command = require("../../base/Command"), Discord = require("discord.js"), fetch = require("node-fetch"), - gamedig = require("gamedig"), - Sentry = require("@sentry/node"); + gamedig = require("gamedig"); class Minecraft extends Command { constructor(client) { @@ -48,7 +47,7 @@ class Minecraft extends Command { await gamedig.query(options).then((res) => { json = res; }).catch((err) => { - Sentry.captureException(err); + console.error(err); }); if (!json) { @@ -56,7 +55,7 @@ class Minecraft extends Command { await gamedig.query(options).then((res) => { json = res; }).catch((err) => { - Sentry.captureException(err); + console.error(err); }); } diff --git a/config.sample.js b/config.sample.js index 9c820fe5..a377c703 100644 --- a/config.sample.js +++ b/config.sample.js @@ -41,9 +41,7 @@ module.exports = { // DBL: https://discordbots.org/api/docs#mybots dbl: "XXXXXXXXXXX", // AMETHYSTE: https://api.amethyste.moe - amethyste: "XXXXXXXXXXX", - // SENTRY: https://sentry.io (this is not required and not recommended - you can delete the field) - sentryDSN: "XXXXXXXXXXX" + amethyste: "XXXXXXXXXXX" }, /* The others utils links */ others: { diff --git a/index.js b/index.js index f7aa6f1c..ed1eb7e5 100644 --- a/index.js +++ b/index.js @@ -1,25 +1,11 @@ require("./helpers/extenders"); -const Sentry = require("@sentry/node"), - util = require("util"), +const util = require("util"), fs = require("fs"), readdir = util.promisify(fs.readdir), mongoose = require("mongoose"), - chalk = require("chalk"), { Intents } = require("discord.js"); -const config = require("./config"); -if (config.apiKeys.sentryDSN) { - try { - Sentry.init({ - dsn: config.apiKeys.sentryDSN - }); - } catch (e) { - console.log(e); - console.log(chalk.yellow("Looks like your Sentry DSN key is invalid. If you do not intend to use Sentry, please remove the key from the configuration file.")); - } -} - // Load JaBa class const JaBa = require("./base/JaBa"); const client = new JaBa({ diff --git a/package.json b/package.json index 85174a04..dd04a5b5 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "@distube/spotify": "^1.2.1", "@distube/yt-dlp": "^1.0.2", "@k3rn31p4nic/google-translate-api": "github:k3rn31p4nic/google-translate-api", - "@sentry/node": "6.3.6", "@sindresorhus/slugify": "^1.1.0", "amethyste-api": "github:Androz2091/amethyste-api", "btoa": "^1.2.1", diff --git a/scripts/verify-config.js b/scripts/verify-config.js index 71bd1fbb..4cc801cf 100644 --- a/scripts/verify-config.js +++ b/scripts/verify-config.js @@ -7,8 +7,6 @@ const success = (message) => console.log(` ${chalk.green("✓")} ${message}`); const error = (message, howToFix) => console.log(` ${chalk.red("✗")} ${message}${howToFix ? ` : ${howToFix}` : ""}`); const ignore = (message) => console.log(` ${chalk.yellow("~")} ${message}`); -const delay = (ms) => new Promise((r) => setTimeout(r, ms)); - const checks = [ () => { console.log("\n\nEnvironnement"); @@ -112,20 +110,6 @@ const checks = [ success("Valid DBL key"); } } - if (!config.apiKeys.sentryDSN) { - ignore("SentryDSN is not configured, key should not be checked."); - } else { - const Sentry = require("@sentry/node"); - try { - Sentry.init({ - dsn: config.apiKeys.sentryDSN - }); - await delay(1000); - success("should be a valid Sentry DSN key"); - } catch (e) { - error("valid Sentry DSN key", "Sentry is not recommended, delete the key from the config"); - } - } resolve(); }); },