Skip to content

Commit

Permalink
Fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Kathund committed Dec 28, 2024
1 parent fab1988 commit 21b43b8
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function updateCode() {

exec("git pull", (error, stdout, stderr) => {
if (error) {
Logger.console.error(error);
console.error(error);
return;
}

Expand Down
9 changes: 4 additions & 5 deletions src/discord/DiscordManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const MessageHandler = require("./handlers/MessageHandler.js");
const StateHandler = require("./handlers/StateHandler.js");
const CommandHandler = require("./CommandHandler.js");
const config = require("../../config.json");
const Logger = require(".././Logger.js");
const path = require("node:path");
const fs = require("fs");

Expand All @@ -33,7 +32,7 @@ class DiscordManager extends CommunicationBridge {
this.client.on("messageCreate", (message) => this.messageHandler.onMessage(message));

this.client.login(config.discord.bot.token).catch((error) => {
Logger.console.error(error);
console.error(error);
});

client.commands = new Collection();
Expand Down Expand Up @@ -93,7 +92,7 @@ class DiscordManager extends CommunicationBridge {
const mode = chat === "debugChannel" ? "minecraft" : config.discord.other.messageMode.toLowerCase();
message = chat === "debugChannel" ? fullMessage : message;
if (message !== undefined && chat !== "debugChannel") {
Logger.broadcastMessage(
console.broadcast(
`${username} [${guildRank.replace(/§[0-9a-fk-or]/g, "").replace(/^\[|\]$/g, "")}]: ${message}`,
`Discord`,
);
Expand All @@ -106,7 +105,7 @@ class DiscordManager extends CommunicationBridge {

const channel = await this.stateHandler.getChannel(chat || "Guild");
if (channel === undefined) {
Logger.console.error(`Channel ${chat} not found!`);
console.error(`Channel ${chat} not found!`);
return;
}
if (username === bot.username && message.endsWith("Check Discord Bridge for image.")) {
Expand Down Expand Up @@ -181,7 +180,7 @@ class DiscordManager extends CommunicationBridge {
}

async onBroadcastCleanEmbed({ message, color, channel }) {
Logger.broadcastMessage(message, "Event");
console.broadcast(message, "Event");

channel = await this.stateHandler.getChannel(channel);
channel.send({
Expand Down
6 changes: 3 additions & 3 deletions src/discord/handlers/StateHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class StateHandler {

global.guild = await client.guilds.fetch(config.discord.bot.serverID);
if (guild === undefined) {
return Logger.console.error(`Guild not found!`);
return console.error(`Guild not found!`);
}

console.discord("Guild ready, successfully fetched " + guild.name);
Expand All @@ -40,7 +40,7 @@ class StateHandler {
async onClose() {
const channel = await this.getChannel("Guild");
if (channel === undefined) {
return Logger.console.error(`Channel "Guild" not found!`);
return console.error(`Channel "Guild" not found!`);
}

await channel.send({
Expand All @@ -55,7 +55,7 @@ class StateHandler {

async getChannel(type) {
if (typeof type !== "string" || type === undefined) {
return Logger.console.error(`Channel type must be a string!`);
return console.error(`Channel type must be a string!`);
}

switch (type.replace(/§[0-9a-fk-or]/g, "").trim()) {
Expand Down
1 change: 0 additions & 1 deletion src/discord/other/updateUsers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const updateRolesCommand = require("../commands/forceUpdateEveryone.js");
const config = require("../../../config.json");
const Logger = require("../../Logger.js");
const cron = require("node-cron");

if (config.verification.autoUpdater) {
Expand Down
1 change: 0 additions & 1 deletion src/minecraft/handlers/ChatHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const { isUuid } = require("../../../API/utils/uuid.js");
const messages = require("../../../messages.json");
const { EmbedBuilder } = require("discord.js");
const config = require("../../../config.json");
const Logger = require("../../Logger.js");
const { readFileSync } = require("fs");

class StateHandler extends eventHandler {
Expand Down
2 changes: 1 addition & 1 deletion src/minecraft/handlers/ErrorHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class StateHandler extends eventHandler {
if (this.isConnectionResetError(error)) return;

if (this.isConnectionRefusedError(error)) {
return Logger.console.error("Connection refused while attempting to login via the Minecraft client");
return console.error("Connection refused while attempting to login via the Minecraft client");
}

console.warn(error);
Expand Down
1 change: 0 additions & 1 deletion src/minecraft/handlers/StateHandler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const eventHandler = require("../../contracts/EventHandler.js");
const Logger = require("../../Logger.js");

class StateHandler extends eventHandler {
constructor(minecraft) {
Expand Down

0 comments on commit 21b43b8

Please sign in to comment.