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

+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "commandbot",
"version": "1.0.0-test2",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "commandbot",
"version": "1.0.0-test2",
"version": "1.0.0",
"license": "MIT",
"dependencies": {
"discord.js": "^12.5.3"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "commandbot",
"version": "1.0.0-test2",
"version": "1.0.0",
"description": "A framework that helps you create your own Discord bot easier.",
"type": "module",
"main": "dist/index.js",
+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!`);
+2 -1
View File
@@ -4,6 +4,7 @@
"strict": true,
"moduleResolution": "node",
"declaration": true,
"outDir": "dist"
"outDir": "dist",
"alwaysStrict": true
}
}