Skip to content

Commit

Permalink
Clean up logging on bot start
Browse files Browse the repository at this point in the history
  • Loading branch information
kira0x1 committed Nov 7, 2021
1 parent 48f71a8 commit 33cc858
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ async function init() {
}

client.on('ready', async () => {
const skipDB: boolean = config.args['skipDB'];

// Setup Prefixes
await db.initServers(client);
if (!skipDB) await db.initServers(client);

// Setup players
util.initPlayers(client);
Expand All @@ -83,7 +85,7 @@ client.on('ready', async () => {
// Read command files and create a collection for the commands
sys.initCommands();

logger.log('info', chalk.bgCyan.bold(`${client.user.username} online!`));
logger.info(chalk.bgCyan.bold(`${client.user.username} online in ${client.guilds.cache.size} servers!`));
});

// eslint-disable-next-line complexity
Expand Down
3 changes: 2 additions & 1 deletion src/database/api/serverApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ export async function initServers(client: Client) {

servers.map(server => {
const serverPrefix = server.prefixes.find(s => s.botId === client.user.id)?.prefix;
if (serverPrefix) logger.info(`prefix for ${server.serverName}: ${serverPrefix}`);
// if (serverPrefix) logger.info(`prefix for ${server.serverName}: ${serverPrefix}`);

prefixes.set(server.serverId, serverPrefix || defaultPrefix);

// Set banned channels to collection
Expand Down
2 changes: 1 addition & 1 deletion src/util/musicUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export async function initPlayers(client: Client) {

client.guilds.cache.map(async guild => {
const guildResolved = await client.guilds.fetch(guild.id);
logger.log('info', chalk.bgBlue.bold(`${guildResolved.name}, ${guildResolved.id}`));
// logger.log('info', chalk.bgBlue.bold(`${guildResolved.name}, ${guildResolved.id}`));
players.set(guildResolved.id, new Player(guildResolved, client));
});

Expand Down

0 comments on commit 33cc858

Please sign in to comment.