/[sudobot]/trunk/src/automod/Cooldown.ts
ViewVC logotype

Diff of /trunk/src/automod/Cooldown.ts

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

revision 56 by rakin, Mon Jul 29 17:28:24 2024 UTC revision 125 by rakin, Mon Jul 29 17:28:41 2024 UTC
# Line 1  Line 1 
1  import { CommandInteraction, GuildMember, Message, User } from "discord.js";  import { CommandInteraction, ContextMenuInteraction, GuildMember, Message, User } from "discord.js";
2  import DiscordClient from "../client/Client";  import DiscordClient from "../client/Client";
3  import MessageEmbed from "../client/MessageEmbed";  import MessageEmbed from "../client/MessageEmbed";
4  import CommandOptions from "../types/CommandOptions";  import CommandOptions from "../types/CommandOptions";
# Line 23  export default class Cooldown { Line 23  export default class Cooldown {
23          this.config = {} as CooldownConfig;          this.config = {} as CooldownConfig;
24      }      }
25    
26      async start(msg: Message | CommandInteraction, options: CommandOptions | InteractionOptions): Promise <boolean> {      async start(msg: Message | CommandInteraction | ContextMenuInteraction, options: CommandOptions | InteractionOptions): Promise <boolean> {
27          this.config = this.client.config.get('cooldown');          this.config = this.client.config.get('cooldown');
28    
29          const { cmdName } = options;          const { cmdName } = options;
# Line 60  export default class Cooldown { Line 60  export default class Cooldown {
60                  embeds: [                  embeds: [
61                      new MessageEmbed()                      new MessageEmbed()
62                      .setColor('#f14a60')                      .setColor('#f14a60')
63                      .setDescription(':clock: Please try again in ' + timeProcess((time - ((new Date()).getTime() - this.cooldownTimes[index].getTime())) / 1000))                      .setDescription(':clock: Please try again in ' + timeProcess(((time - ((new Date()).getTime() - this.cooldownTimes[index].getTime())) + 1) / 1000))
64                  ]                  ]
65              });              });
66    

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26