From 6c687d5a2e6d81ff702b65975142e3db11bb0041 Mon Sep 17 00:00:00 2001 From: GRZ4NA Date: Tue, 31 Aug 2021 18:40:35 +0200 Subject: [PATCH] improving safety - freezing command object --- src/Bot.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Bot.ts b/src/Bot.ts index 2153a89..ecfbfc0 100644 --- a/src/Bot.ts +++ b/src/Bot.ts @@ -132,6 +132,7 @@ export class Bot extends EventEmitter { const helpMsg: Command = new HelpMessage(this.commands, this.messages.help, this.name); this.commands.add(helpMsg); } + Object.freeze(this.commands); process.stdout.write("Connecting to Discord... "); this.client.login(this.token); this.client.on("ready", async () => {