/[sudobot]/trunk/src/utils/structures/BaseCommand.ts
ViewVC logotype

Diff of /trunk/src/utils/structures/BaseCommand.ts

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

revision 81 by rakin, Mon Jul 29 17:28:31 2024 UTC revision 125 by rakin, Mon Jul 29 17:28:41 2024 UTC
# Line 1  Line 1 
1  import { ModalSubmitInteraction } from 'discord-modals';  import { ModalSubmitInteraction } from 'discord-modals';
2  import { AutocompleteInteraction, CommandInteraction, CommandInteractionOption, Interaction, Message, MessageEditOptions, MessageOptions, MessagePayload, WebhookEditMessageOptions } from 'discord.js';  import { AutocompleteInteraction, CommandInteraction, CommandInteractionOption, ContextMenuInteraction, Interaction, Message, MessageEditOptions, MessageOptions, MessagePayload, WebhookEditMessageOptions } from 'discord.js';
3  import DiscordClient from '../../client/Client';  import DiscordClient from '../../client/Client';
4  import AutoCompleteOptions from '../../types/AutoCompleteOptions';  import AutoCompleteOptions from '../../types/AutoCompleteOptions';
5  import CommandOptions from '../../types/CommandOptions';  import CommandOptions from '../../types/CommandOptions';
# Line 8  import InteractionOptions from '../../ty Line 8  import InteractionOptions from '../../ty
8  export default abstract class BaseCommand {  export default abstract class BaseCommand {
9      supportsInteractions: boolean = false;      supportsInteractions: boolean = false;
10      supportsLegacy: boolean = true;      supportsLegacy: boolean = true;
11        supportsContextMenu: boolean = false;
12      coolDown?: number;      coolDown?: number;
13      ownerOnly: boolean = false;      ownerOnly: boolean = false;
14    
# Line 39  export default abstract class BaseComman Line 40  export default abstract class BaseComman
40                    
41      }      }
42    
43      async deferReply(msg: Message | CommandInteraction, options: MessageOptions | string | MessagePayload | WebhookEditMessageOptions, edit: boolean = false): Promise<Message | CommandInteraction> {      async deferReply(msg: Message | CommandInteraction | ContextMenuInteraction, options: MessageOptions | string | MessagePayload | WebhookEditMessageOptions, edit: boolean = false): Promise<Message | CommandInteraction> {
44          if (msg instanceof Message) {          if (msg instanceof Message) {
45              return await msg[edit ? 'edit' : 'reply'](options as (MessageOptions & MessageEditOptions));              return await msg[edit ? 'edit' : 'reply'](options as (MessageOptions & MessageEditOptions));
46          }          }

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26