/[sudobot]/trunk/src/services/Auth.ts
ViewVC logotype

Diff of /trunk/src/services/Auth.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 226 by rakin, Mon Jul 29 17:29:06 2024 UTC revision 266 by rakin, Mon Jul 29 17:29:17 2024 UTC
# Line 5  import Service from "../utils/structures Line 5  import Service from "../utils/structures
5    
6  export default class Auth extends Service {  export default class Auth extends Service {
7      async verify(member: GuildMember, command: BaseCommand): Promise<boolean> {      async verify(member: GuildMember, command: BaseCommand): Promise<boolean> {
8            if (command.ownerOnly && !this.client.config.props.global.owners.includes(member.user.id)) {
9                return false;
10            }
11    
12          const cmds: string[] = await this.client.config.get('global_commands');          const cmds: string[] = await this.client.config.get('global_commands');
13    
14          if (cmds.indexOf(command.getName()) !== -1) {          if (cmds.indexOf(command.getName()) !== -1) {
15              return true;              return true;
16          }          }
17    
         if (command.ownerOnly && !this.client.config.props.global.owners.includes(member.user.id)) {  
             return false;  
         }  
   
18          if (await member.roles.cache.has(await this.client.config.get('mod_role'))) {          if (await member.roles.cache.has(await this.client.config.get('mod_role'))) {
19              let restricted: string[] = [];              let restricted: string[] = [];
20              const roleCommands: { [key: string]: string[] } = await this.client.config.get('role_commands');              const roleCommands: { [key: string]: string[] } = await this.client.config.get('role_commands');

Legend:
Removed from v.226  
changed lines
  Added in v.266

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26