Skip to content

Commit 768553f

Browse files
committed
chore: Updated max event listerns to get rid of warning
1 parent 138d7a8 commit 768553f

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
// BOT INFO //
66
prefix: "t?", // Default prefix
77
status: "dnd",
8-
eventListeners: 50,
8+
eventListeners: 20,
99
botName: "testify",
1010
dev: "Kkermit",
1111
devBy: "| Developed by kkermit",

src/events/ReadyEvents/ready.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ module.exports = {
1111

1212
client.logs.info(`[SCHEMAS] Started loading schemas...`);
1313

14-
client.setMaxListeners(client.config.eventListeners || 20);
15-
1614
if (!mongodbURL) {
1715
client.logs.error(`[DATABASE] No MongoDB URL has been provided. Double check your .env file and make sure it is correct. MongoDB is ${textEffects.bold}required${textEffects.reset} for ${client.user.username} to function.`);
1816
return;

src/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ try {
4747
console.error(`${color.red}[${getTimestamp()}]${color.reset} [ERROR] Error while creating the client. \n${color.red}[${getTimestamp()}]${color.reset} [ERROR]`, error);
4848
};
4949

50+
const listeners = config.eventListeners || 20;
51+
52+
if (listeners > 0) {
53+
client.setMaxListeners(listeners);
54+
} else {
55+
client.setMaxListeners(0);
56+
}
57+
5058
client.logs = require('./utils/logs');
5159
client.config = require('./config');
5260

0 commit comments

Comments
 (0)