feat(CommandInteractionResolvedData): access to "raw" resolved data (#6384)

Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
This commit is contained in:
monbrey
2021-08-13 00:04:40 +10:00
committed by GitHub
parent d9456a1a76
commit fff887b2f4
5 changed files with 83 additions and 2 deletions

10
typings/index.d.ts vendored
View File

@@ -270,6 +270,7 @@ export abstract class BaseCommandInteraction extends Interaction {
option: APIApplicationCommandOption,
resolved: APIApplicationCommandInteractionData['resolved'],
): CommandInteractionOption;
private transformResolved(resolved: APIApplicationCommandInteractionData['resolved']): CommandInteractionResolvedData;
}
export abstract class BaseGuild extends Base {
@@ -534,6 +535,7 @@ export class CommandInteractionOptionResolver {
public constructor(client: Client, options: CommandInteractionOption[]);
public readonly client: Client;
public readonly data: readonly CommandInteractionOption[];
public readonly resolved: Readonly<CommandInteractionResolvedData>;
private _group: string | null;
private _hoistedOptions: CommandInteractionOption[];
private _subcommand: string | null;
@@ -3281,6 +3283,14 @@ export interface CommandInteractionOption {
message?: Message | APIMessage;
}
export interface CommandInteractionResolvedData {
users?: Collection<string, User>;
members?: Collection<string, GuildMember | APIInteractionDataResolvedGuildMember>;
roles?: Collection<string, Role | APIRole>;
channels?: Collection<string, Channel | APIInteractionDataResolvedChannel>;
messages?: Collection<string, Message | APIMessage>;
}
export interface ConstantsClientApplicationAssetTypes {
SMALL: 1;
BIG: 2;