/[sudobot]/trunk/src/CommandManager.js
ViewVC logotype

Diff of /trunk/src/CommandManager.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6 by rakin, Mon Jul 29 17:28:11 2024 UTC revision 7 by rakin, Mon Jul 29 17:28:12 2024 UTC
# Line 12  class CommandManager { Line 12  class CommandManager {
12          this.commandName = "";          this.commandName = "";
13          this.argv = [];          this.argv = [];
14          this.args = [];          this.args = [];
15            this.options = [];
16            this.normalArgs = [];
17          this.loadCommands();          this.loadCommands();
18          this.snippetManager = new SnippetManager();          this.snippetManager = new SnippetManager();
19      }      }
# Line 66  class CommandManager { Line 68  class CommandManager {
68      }      }
69    
70      async exec() {      async exec() {
71          return await this.commands[this.commandName].handle(this.msg, this);          let cmd = this.commands[this.commandName];
72    
73            if (cmd.needsOptionParse) {
74                this.normalArgs = await this.args.filter(arg => arg[0] !== '-');
75                this.options = await this.args.filter(arg => arg[0] === '-');
76            }
77    
78            return await cmd.handle(this.msg, this);
79      }      }
80  }  }
81    

Legend:
Removed from v.6  
changed lines
  Added in v.7

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26