/[sudobot]/trunk/src/events/interaction/InteractionCreateEvent.ts
ViewVC logotype

Diff of /trunk/src/events/interaction/InteractionCreateEvent.ts

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

revision 125 by rakin, Mon Jul 29 17:28:41 2024 UTC revision 344 by rakin, Mon Jul 29 17:29:40 2024 UTC
# Line 1  Line 1 
1  import BaseEvent from '../../utils/structures/BaseEvent';  import BaseEvent from '../../utils/structures/BaseEvent';
2  import { GuildMember, Interaction, Message, MessageEmbed } from 'discord.js';  import { GuildMember, Interaction, MessageEmbed } from 'discord.js';
3  import DiscordClient from '../../client/Client';  import DiscordClient from '../../client/Client';
 import CommandOptions from '../../types/CommandOptions';  
4  import InteractionOptions from '../../types/InteractionOptions';  import InteractionOptions from '../../types/InteractionOptions';
5  import AutoCompleteOptions from '../../types/AutoCompleteOptions';  import AutoCompleteOptions from '../../types/AutoCompleteOptions';
6    
# Line 50  export default class InteractionCreateEv Line 49  export default class InteractionCreateEv
49                      isInteraction: true                      isInteraction: true
50                  } as InteractionOptions;                  } as InteractionOptions;
51    
52                  if (!await client.cooldown.start(interaction, options))                  await command.execute(client, interaction, options);
                     return;  
   
                 await command.run(client, interaction, options);  
53                  (global as any).lastCommand = commandName;                  (global as any).lastCommand = commandName;
54              }              }
55          }          }
# Line 71  export default class InteractionCreateEv Line 67  export default class InteractionCreateEv
67                      return;                      return;
68                  }                  }
69    
70                    if (!(await command.perms(client, interaction))) {
71                        return;
72                    }
73    
74                  const options = {                  const options = {
75                      cmdName: commandName,                      cmdName: commandName,
76                      options: interaction.options,                      options: interaction.options,
# Line 97  export default class InteractionCreateEv Line 97  export default class InteractionCreateEv
97                  if (!allowed) {                  if (!allowed) {
98                      return;                      return;
99                  }                  }
100                    
101                    if (!(await command.perms(client, interaction))) {
102                        return;
103                    }
104    
105                  await command.default(client, interaction);                  await command.default(client, interaction);
106              }              }

Legend:
Removed from v.125  
changed lines
  Added in v.344

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26