Archived
return types response
This commit is contained in:
1 parent
c7c0a465bb
commit
16b5548d9b
1 file changed
+7
-1
+7
-1
@@ -54,7 +54,13 @@ class Command {
|
||||
async start(message?: Message, cmdArguments?: string[]) {
|
||||
const memberPermissions : Readonly<Permissions> = message?.member?.permissions || new Permissions(0);
|
||||
if(memberPermissions.any(this.permissions, true)) {
|
||||
await this.function(message, cmdArguments);
|
||||
const fnResult = await this.function(message, cmdArguments);
|
||||
if(typeof fnResult == 'string') {
|
||||
await message?.reply(fnResult);
|
||||
}
|
||||
else if(fnResult instanceof MessageEmbed) {
|
||||
await message?.channel.send(fnResult);
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new PermissionsError(this, message?.member);
|
||||
|
||||
Reference in new issue
Block a user