Archived
1.0.0
This commit is contained in:
1 parent
7d39b9d743
commit
be4d1f65a8
5 files changed
+9
-5
No files matched your search
+1
-1
@@ -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> {
|
||||
|
||||
@@ -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!`);
|
||||
|
||||
Reference in new issue
Block a user