Skip to content

Commit

Permalink
create interfaces for commands
Browse files Browse the repository at this point in the history
  • Loading branch information
yorunoken committed Oct 18, 2024
1 parent d75fbc2 commit 16da05b
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/types/interfaces/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import type { ApplicationCommandData, GuildInteraction } from "@lilybird/transformers";
import type { Client, ApplicationCommand } from "lilybird";

type Awaitable<T> = Promise<T> | T;

export interface PrefixCommand {
data: {
name: string;
aliases?: Array<string>;
cooldownMs: number;
};

info: {
description: string;
details?: string;
usage: string;
category: string;
flags?: string;
};

exec: () => Awaitable<void>;
}

export interface ApplicationCommand {
data: ApplicationCommand.Create.ApplicationCommandJSONParams;

info: {
description: string;
details?: string;
usage: string;
category: string;
flags?: string;
};

exec: (interaction: GuildInteraction<ApplicationCommandData>) => Awaitable<any>;
}

export interface DefaultApplicationCommand {
default: ApplicationCommand;
}

export interface DefaultPrefixCommand {
default: PrefixCommand;
}

0 comments on commit 16da05b

Please sign in to comment.