mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 05:04:58 +05:00
Удалён Sentry (не используется)
This commit is contained in:
parent
afc8dc8671
commit
f1d47c730f
5 changed files with 5 additions and 39 deletions
|
@ -1,8 +1,7 @@
|
||||||
const Command = require("../../base/Command"),
|
const Command = require("../../base/Command"),
|
||||||
Discord = require("discord.js"),
|
Discord = require("discord.js"),
|
||||||
fetch = require("node-fetch"),
|
fetch = require("node-fetch"),
|
||||||
gamedig = require("gamedig"),
|
gamedig = require("gamedig");
|
||||||
Sentry = require("@sentry/node");
|
|
||||||
|
|
||||||
class Minecraft extends Command {
|
class Minecraft extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
|
@ -48,7 +47,7 @@ class Minecraft extends Command {
|
||||||
await gamedig.query(options).then((res) => {
|
await gamedig.query(options).then((res) => {
|
||||||
json = res;
|
json = res;
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
Sentry.captureException(err);
|
console.error(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!json) {
|
if (!json) {
|
||||||
|
@ -56,7 +55,7 @@ class Minecraft extends Command {
|
||||||
await gamedig.query(options).then((res) => {
|
await gamedig.query(options).then((res) => {
|
||||||
json = res;
|
json = res;
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
Sentry.captureException(err);
|
console.error(err);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,9 +41,7 @@ module.exports = {
|
||||||
// DBL: https://discordbots.org/api/docs#mybots
|
// DBL: https://discordbots.org/api/docs#mybots
|
||||||
dbl: "XXXXXXXXXXX",
|
dbl: "XXXXXXXXXXX",
|
||||||
// AMETHYSTE: https://api.amethyste.moe
|
// AMETHYSTE: https://api.amethyste.moe
|
||||||
amethyste: "XXXXXXXXXXX",
|
amethyste: "XXXXXXXXXXX"
|
||||||
// SENTRY: https://sentry.io (this is not required and not recommended - you can delete the field)
|
|
||||||
sentryDSN: "XXXXXXXXXXX"
|
|
||||||
},
|
},
|
||||||
/* The others utils links */
|
/* The others utils links */
|
||||||
others: {
|
others: {
|
||||||
|
|
16
index.js
16
index.js
|
@ -1,25 +1,11 @@
|
||||||
require("./helpers/extenders");
|
require("./helpers/extenders");
|
||||||
|
|
||||||
const Sentry = require("@sentry/node"),
|
const util = require("util"),
|
||||||
util = require("util"),
|
|
||||||
fs = require("fs"),
|
fs = require("fs"),
|
||||||
readdir = util.promisify(fs.readdir),
|
readdir = util.promisify(fs.readdir),
|
||||||
mongoose = require("mongoose"),
|
mongoose = require("mongoose"),
|
||||||
chalk = require("chalk"),
|
|
||||||
{ Intents } = require("discord.js");
|
{ 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
|
// Load JaBa class
|
||||||
const JaBa = require("./base/JaBa");
|
const JaBa = require("./base/JaBa");
|
||||||
const client = new JaBa({
|
const client = new JaBa({
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
"@distube/spotify": "^1.2.1",
|
"@distube/spotify": "^1.2.1",
|
||||||
"@distube/yt-dlp": "^1.0.2",
|
"@distube/yt-dlp": "^1.0.2",
|
||||||
"@k3rn31p4nic/google-translate-api": "github:k3rn31p4nic/google-translate-api",
|
"@k3rn31p4nic/google-translate-api": "github:k3rn31p4nic/google-translate-api",
|
||||||
"@sentry/node": "6.3.6",
|
|
||||||
"@sindresorhus/slugify": "^1.1.0",
|
"@sindresorhus/slugify": "^1.1.0",
|
||||||
"amethyste-api": "github:Androz2091/amethyste-api",
|
"amethyste-api": "github:Androz2091/amethyste-api",
|
||||||
"btoa": "^1.2.1",
|
"btoa": "^1.2.1",
|
||||||
|
|
|
@ -7,8 +7,6 @@ const success = (message) => console.log(` ${chalk.green("✓")} ${message}`);
|
||||||
const error = (message, howToFix) => console.log(` ${chalk.red("✗")} ${message}${howToFix ? ` : ${howToFix}` : ""}`);
|
const error = (message, howToFix) => console.log(` ${chalk.red("✗")} ${message}${howToFix ? ` : ${howToFix}` : ""}`);
|
||||||
const ignore = (message) => console.log(` ${chalk.yellow("~")} ${message}`);
|
const ignore = (message) => console.log(` ${chalk.yellow("~")} ${message}`);
|
||||||
|
|
||||||
const delay = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
||||||
|
|
||||||
const checks = [
|
const checks = [
|
||||||
() => {
|
() => {
|
||||||
console.log("\n\nEnvironnement");
|
console.log("\n\nEnvironnement");
|
||||||
|
@ -112,20 +110,6 @@ const checks = [
|
||||||
success("Valid DBL key");
|
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();
|
resolve();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue