#5 replace all console.logs with debugger
All checks were successful
DRB Tests / drb_mocha_tests (pull_request) Successful in 32s

This commit is contained in:
Logan Cusano
2024-05-25 23:52:18 -04:00
parent 81a215f048
commit 2ab5a181bd
22 changed files with 192 additions and 133 deletions

View File

@@ -1,3 +1,5 @@
import { DebugBuilder } from "../../modules/debugger.mjs";
const log = new DebugBuilder("server", "discordBot.modules.wrappers");
import { checkIfNodeIsConnectedToVC, getNodeDiscordID, getNodeDiscordUsername } from '../../modules/socketServerWrappers.mjs';
import { getAllDiscordIDs } from '../../modules/mongo-wrappers/mongoDiscordIDWrappers.mjs'
@@ -8,7 +10,7 @@ export const checkOnlineBotsInGuild = async (nodeIo, guildId) => {
await Promise.all(openSockets.map(async openSocket => {
openSocket = await nodeIo.sockets.sockets.get(openSocket);
const connected = await checkIfNodeIsConnectedToVC(nodeIo, guildId, openSocket.node.nuid);
console.log("Connected:", connected);
log.INFO("Connected:", connected);
if (connected) {
const username = await getNodeDiscordUsername(openSocket, guildId);
const discordID = await getNodeDiscordID(openSocket);
@@ -33,8 +35,8 @@ export const checkOnlineBotsInGuild = async (nodeIo, guildId) => {
]);
// Use the results of both promises here
console.log("Available Discord IDs:", discordIDs);
console.log("Online bots in the guild:", onlineBots);
log.INFO("Available Discord IDs:", discordIDs);
log.INFO("Online bots in the guild:", onlineBots);
// Filter any discordIDs that are not active
const availableDiscordIDs = discordIDs.filter(discordID => discordID.active == true).filter(discordID => !onlineBots.some(bot => Number(bot.discord_id) == discordID.discord_id));