This commit is contained in:
mmacierzanka committed 2021-06-27 00:24:18 +02:00
1 parent 7d39b9d743
commit be4d1f65a8
5 files changed
+9 -5

No files matched your search

+1 -1
View File
@@ -54,7 +54,7 @@ class Bot {
}
this.on = {
message: (m: Message) => {},
command: (m: Message, cmdInfo?: CommandMessageStructure) => { console.log(cmdInfo); }
command: (m: Message, cmdInfo?: CommandMessageStructure) => {}
}
}
async start(port?: number, token?: string) : Promise<boolean> {
+3
View File
@@ -144,6 +144,9 @@ class CommandManager {
}
add(command: Command) : boolean {
try {
if(!(command instanceof Command)) {
throw new TypeError('Inavlid argument type');
}
this.list.map((c) => {
if(c.name == command.name) {
throw new Error(`Command with name "${c.name}" already exists!`);