12 |
coolDown?: number; |
coolDown?: number; |
13 |
ownerOnly: boolean = false; |
ownerOnly: boolean = false; |
14 |
permissions: PermissionResolvable[] = []; |
permissions: PermissionResolvable[] = []; |
15 |
|
|
16 |
|
|
17 |
constructor(private name: string, private category: string, private aliases: Array<string>) { |
constructor(private name: string, private category: string, private aliases: Array<string>) { |
18 |
|
|
19 |
} |
} |
20 |
|
|
21 |
getName(): string { |
getName(): string { |
22 |
return this.name; |
return this.name; |
23 |
} |
} |
24 |
|
|
25 |
getCategory(): string { |
getCategory(): string { |
26 |
return this.category; |
return this.category; |
27 |
} |
} |
28 |
|
|
29 |
getAliases(): Array<string> { |
getAliases(): Array<string> { |
30 |
return this.aliases; |
return this.aliases; |
31 |
} |
} |
32 |
|
|
33 |
|
async permissionValidation(client: DiscordClient, member: GuildMember): Promise <boolean> { |
34 |
|
return true; |
35 |
|
} |
36 |
|
|
37 |
async autoComplete(client: DiscordClient, interaction: AutocompleteInteraction, options: AutoCompleteOptions): Promise <void> { |
async autoComplete(client: DiscordClient, interaction: AutocompleteInteraction, options: AutoCompleteOptions): Promise <void> { |
38 |
|
|
88 |
} |
} |
89 |
} |
} |
90 |
|
|
91 |
|
if (message instanceof Interaction && !message.isRepliable()) |
92 |
|
return; |
93 |
|
|
94 |
|
if (!(await this.permissionValidation(client, member!))) { |
95 |
|
await message.reply({ |
96 |
|
embeds: [ |
97 |
|
{ |
98 |
|
description: ":x: You don't have enough permissions to run this command.", |
99 |
|
color: 0xf14a60 |
100 |
|
} |
101 |
|
] |
102 |
|
}); |
103 |
|
|
104 |
|
return false; |
105 |
|
} |
106 |
|
|
107 |
return true; |
return true; |
108 |
} |
} |
109 |
|
|