Skip to content

Commit

Permalink
do the thing
Browse files Browse the repository at this point in the history
  • Loading branch information
DonovanDMC committed Nov 28, 2021
1 parent d21684a commit 93357d7
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,33 +77,33 @@ declare namespace Eris {

// Interaction
type InteractionType = Constants["ApplicationCommandTypes"][keyof Constants["ApplicationCommandTypes"]];
type InteractionDataOptions = InteractionDataOptionsSubCommand | InteractionDataOptionsSubCommandGroup | InteractionDataOptionsWithValue;
type InteractionDataOptionsWithValue = InteractionDataOptionsString | InteractionDataOptionsInteger | InteractionDataOptionsBoolean | InteractionDataOptionsUser | InteractionDataOptionsChannel | InteractionDataOptionsRole | InteractionDataOptionsMentionable | InteractionDataOptionsNumber;
interface InteractionDataOptionsSubCommand {
type InteractionDataOption = InteractionDataOptionSubCommand | InteractionDataOptionSubCommandGroup | InteractionDataOptionsWithValue;
type InteractionDataOptionsWithValue = InteractionDataOptionString | InteractionDataOptionInteger | InteractionDataOptionBoolean | InteractionDataOptionUser | InteractionDataOptionChannel | InteractionDataOptionRole | InteractionDataOptionMentionable | InteractionDataOptionNumber;
interface InteractionDataOptionSubCommand {
name: string;
type: Constants["ApplicationCommandOptionTypes"]["SUB_COMMAND"];
options?: InteractionDataOptionsWithValue[];
}
interface InteractionDataOptionsSubCommandGroup {
interface InteractionDataOptionSubCommandGroup {
name: string;
type: Constants["ApplicationCommandOptionTypes"]["SUB_COMMAND_GROUP"];
// technically these can have zero options, but it will then not show in the client
options: (InteractionDataOptionsSubCommand | InteractionDataOptionsWithValue)[];
options: (InteractionDataOptionSubCommand | InteractionDataOptionWithValue)[];
}
interface InteractionDataOptionWithValue<T extends (Constants["ApplicationCommandOptionTypes"])[Exclude<keyof Constants["ApplicationCommandOptionTypes"], "SUB_COMMAND" | "SUB_COMMAND_GROUP">] = (Constants["ApplicationCommandOptionTypes"])[Exclude<keyof Constants["ApplicationCommandOptionTypes"], "SUB_COMMAND" | "SUB_COMMAND_GROUP">], V = unknown> {
name: string;
type: T;
value: V;
focused?: boolean;
}
type InteractionDataOptionsString = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["STRING"], string>;
type InteractionDataOptionsInteger = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["INTEGER"], number>;
type InteractionDataOptionsBoolean = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["BOOLEAN"], boolean>;
type InteractionDataOptionsUser = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["USER"], string>;
type InteractionDataOptionsChannel = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["CHANNEL"], string>;
type InteractionDataOptionsRole = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["ROLE"], string>;
type InteractionDataOptionsMentionable = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["MENTIONABLE"], string>;
type InteractionDataOptionsNumber = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["NUMBER"], number>;
type InteractionDataOptionString = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["STRING"], string>;
type InteractionDataOptionInteger = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["INTEGER"], number>;
type InteractionDataOptionBoolean = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["BOOLEAN"], boolean>;
type InteractionDataOptionUser = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["USER"], string>;
type InteractionDataOptionChannel = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["CHANNEL"], string>;
type InteractionDataOptionRole = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["ROLE"], string>;
type InteractionDataOptionMentionable = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["MENTIONABLE"], string>;
type InteractionDataOptionNumber = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["NUMBER"], number>;

type InteractionResponse = InteractionMessageResponse | InteractionDeferredResponse | InteractionAutocompleteResponse;

Expand All @@ -129,7 +129,7 @@ declare namespace Eris {
type InteractionEditContent = Pick<WebhookPayload, "content" | "embeds" | "allowedMentions" | "components">;

// Application Commands
type ApplicationCommandTypes = Constants["ApplicationCommandTypes"][keyof Constants["ApplicationCommandTypes"]];
type ApplicationCommandType = Constants["ApplicationCommandTypes"][keyof Constants["ApplicationCommandTypes"]];
type ApplicationCommandOptionType = Constants["ApplicationCommandOptionTypes"][keyof Constants["ApplicationCommandOptionTypes"]];
type ApplicationCommandOptionTypeWithValue = Constants["ApplicationCommandOptionTypes"][Exclude<keyof Constants["ApplicationCommandOptionTypes"], "SUB_COMMAND" | "SUB_COMMAND_GROUP">];
type ApplicationCommandOptionTypeWithChoices = Constants["ApplicationCommandOptionTypes"][keyof Pick<Constants["ApplicationCommandOptionTypes"], "STRING" | "INTEGER" | "NUMBER">];
Expand Down Expand Up @@ -191,7 +191,7 @@ declare namespace Eris {
type ApplicationCommandOptionNumber = ApplicationCommandOptionGeneric<Constants["ApplicationCommandOptionTypes"]["NUMBER"]> & (ApplicationCommandOptionAutocomplete | ApplicationCommandOptionChoices<Constants["ApplicationCommandOptionTypes"]["NUMBER"]> | ApplicationCommandOptionMinMax);


interface ApplicationCommand<T extends ApplicationCommandTypes = ApplicationCommandTypes> {
interface ApplicationCommand<T extends ApplicationCommandType = ApplicationCommandType> {
id: string;
application_id: string;
guild_id?: string;
Expand Down Expand Up @@ -2888,7 +2888,7 @@ declare namespace Eris {
channels?: Collection<PartialChannel>;
messages?: Collection<Message>;
};
options?: InteractionDataOptions[];
options?: InteractionDataOption[];
};
guildID?: string;
member?: Member;
Expand Down Expand Up @@ -2943,7 +2943,7 @@ declare namespace Eris {
name: string;
type: Constants["ApplicationCommandTypes"]["CHAT_INPUT"];
target_id?: string;
options: InteractionDataOptions[];
options: InteractionDataOption[];
};
guildID?: string;
member?: Member;
Expand Down

0 comments on commit 93357d7

Please sign in to comment.