command type safety

This commit is contained in:
mmacierzanka committed 2021-06-23 16:43:20 +02:00
1 parent b138679041
commit 78c4f19eca
1 file changed
+1 -1
+1 -1
View File
@@ -53,7 +53,7 @@ class Command {
this.visible = options.visible != undefined ? options.visible : true; this.visible = options.visible != undefined ? options.visible : true;
this.function = options.function; this.function = options.function;
} }
async start(message?: Message, cmdArguments?: string[]) { async start(message?: Message, cmdArguments?: string[]) : Promise<void> {
const memberPermissions : Readonly<Permissions> = message?.member?.permissions || new Permissions(0); const memberPermissions : Readonly<Permissions> = message?.member?.permissions || new Permissions(0);
if(memberPermissions.has(this.permissions, true)) { if(memberPermissions.has(this.permissions, true)) {
const fnResult = await this.function(message, cmdArguments); const fnResult = await this.function(message, cmdArguments);