Skip to content

Commit 8ba8fda

Browse files
committed
Limit debugs size
1 parent e727325 commit 8ba8fda

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/app.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,12 @@ client.on('warn', (warning) => {
4040
});
4141

4242
const debugs: string[] = [];
43+
const MAX_DEBUG_LENGTH = 100;
4344
client.on('debug', (debug) => {
4445
debugs.push(debug.replace(getConfig('DISCORD_BOT_TOKEN'), 'DISCORD_BOT_TOKEN'));
46+
if (debugs.length > MAX_DEBUG_LENGTH) {
47+
debugs.shift();
48+
}
4549
});
4650

4751
client.on('message', async (msg) => {

0 commit comments

Comments
 (0)