1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-08-01 20:54:33 +00:00

Fix code to work on this decade 1/x

This commit is contained in:
Christer Warén
2024-02-10 09:33:59 +02:00
parent 99ecd9787d
commit 86b4676159
61 changed files with 3842 additions and 471 deletions

View File

@@ -1,15 +1,12 @@
const config = require("./src/struct/config/config.js");
const { ShardingManager} = require("discord.js");
const config = require("./src/config/config.js");
const DiscordWebhook = require("discord-webhook-node");
if (config.devMode) {
console.log("- dev mode- ");
config.token = config.devToken;
config.shards = 1;
}
const {
ShardingManager
} = require("discord.js");
const manager = new ShardingManager("./src/bot.js", {
token: config.token,
respawn: config.respawn,
@@ -22,19 +19,13 @@ manager.on("shardCreate", (shard) =>
console.log(`- Launched shard ${shard.id} -`)
);
const webhookClient = new DiscordWebhook.Webhook(config.webhookUrl);
const oldConsole = {};
oldConsole.log = console.log;
console.log = function (arg) {
oldConsole.log(arg);
if (!config.devMode && arg)
webhookClient.send(JSON.stringify(arg));
};
oldConsole.error = console.error;
console.error = function (arg) {
oldConsole.error(arg);
if (!config.devMode && arg)
webhookClient.send(JSON.stringify(arg));
};
};