Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ApplicationCommand): attachment application command option type #272

Merged
merged 6 commits into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';

export type APIApplicationCommandAttachmentOption =
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;

export type APIApplicationCommandInteractionDataAttachmentOption = APIInteractionDataOptionBase<
ApplicationCommandOptionType.Attachment,
Snowflake
>;
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
import type {
APIApplicationCommandBasicOption,
APIApplicationCommandInteractionDataBasicOption,
} from '../chatInput.ts';
import type { APIApplicationCommandOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Snowflake } from '../../../../globals.ts';
import type { APIRole, APIUser } from '../../mod.ts';
import type { APIRole, APIUser, APIAttachment } from '../../mod.ts';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedChannel,
Expand Down Expand Up @@ -41,6 +41,10 @@ import type {
APIApplicationCommandNumberOption,
APIApplicationCommandInteractionDataNumberOption,
} from './_chatInput/number.ts';
import type {
APIApplicationCommandAttachmentOption,
APIApplicationCommandInteractionDataAttachmentOption,
} from './_chatInput/attachment.ts';
import type {
APIApplicationCommandSubcommandOption,
APIApplicationCommandInteractionDataSubcommandOption,
Expand All @@ -58,6 +62,7 @@ export * from './_chatInput/channel.ts';
export * from './_chatInput/role.ts';
export * from './_chatInput/mentionable.ts';
export * from './_chatInput/number.ts';
export * from './_chatInput/attachment.ts';
export * from './_chatInput/subcommand.ts';
export * from './_chatInput/subcommandGroup.ts';
export * from './_chatInput/shared.ts';
Expand All @@ -73,7 +78,8 @@ export type APIApplicationCommandBasicOption =
| APIApplicationCommandChannelOption
| APIApplicationCommandRoleOption
| APIApplicationCommandMentionableOption
| APIApplicationCommandNumberOption;
| APIApplicationCommandNumberOption
| APIApplicationCommandAttachmentOption;

/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
Expand All @@ -99,7 +105,8 @@ export type APIApplicationCommandInteractionDataBasicOption =
| APIApplicationCommandInteractionDataChannelOption
| APIApplicationCommandInteractionDataRoleOption
| APIApplicationCommandInteractionDataMentionableOption
| APIApplicationCommandInteractionDataNumberOption;
| APIApplicationCommandInteractionDataNumberOption
| APIApplicationCommandInteractionDataAttachmentOption;

/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
Expand All @@ -118,6 +125,7 @@ export interface APIChatInputApplicationCommandInteractionDataResolved {
roles?: Record<Snowflake, APIRole>;
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
channels?: Record<Snowflake, APIInteractionDataResolvedChannel>;
attachments?: Record<Snowflake, APIAttachment>;
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';

export type APIApplicationCommandAttachmentOption =
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;

export type APIApplicationCommandInteractionDataAttachmentOption = APIInteractionDataOptionBase<
ApplicationCommandOptionType.Attachment,
Snowflake
>;
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export enum ApplicationCommandOptionType {
Role,
Mentionable,
Number,
Attachment,
amitojsingh366 marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
import type {
APIApplicationCommandBasicOption,
APIApplicationCommandInteractionDataBasicOption,
} from '../chatInput.ts';
import type { APIApplicationCommandOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Snowflake } from '../../../../globals.ts';
import type { APIRole, APIUser } from '../../mod.ts';
import type { APIRole, APIUser, APIAttachment } from '../../mod.ts';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedChannel,
Expand Down Expand Up @@ -41,6 +41,10 @@ import type {
APIApplicationCommandNumberOption,
APIApplicationCommandInteractionDataNumberOption,
} from './_chatInput/number.ts';
import type {
APIApplicationCommandAttachmentOption,
APIApplicationCommandInteractionDataAttachmentOption,
} from './_chatInput/attachment.TS';
import type {
APIApplicationCommandSubcommandOption,
APIApplicationCommandInteractionDataSubcommandOption,
Expand All @@ -58,6 +62,7 @@ export * from './_chatInput/channel.ts';
export * from './_chatInput/role.ts';
export * from './_chatInput/mentionable.ts';
export * from './_chatInput/number.ts';
export * from './_chatInput/attachment.ts';
export * from './_chatInput/subcommand.ts';
export * from './_chatInput/subcommandGroup.ts';
export * from './_chatInput/shared.ts';
Expand All @@ -73,7 +78,8 @@ export type APIApplicationCommandBasicOption =
| APIApplicationCommandChannelOption
| APIApplicationCommandRoleOption
| APIApplicationCommandMentionableOption
| APIApplicationCommandNumberOption;
| APIApplicationCommandNumberOption
| APIApplicationCommandAttachmentOption;

/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
Expand All @@ -99,7 +105,8 @@ export type APIApplicationCommandInteractionDataBasicOption =
| APIApplicationCommandInteractionDataChannelOption
| APIApplicationCommandInteractionDataRoleOption
| APIApplicationCommandInteractionDataMentionableOption
| APIApplicationCommandInteractionDataNumberOption;
| APIApplicationCommandInteractionDataNumberOption
| APIApplicationCommandInteractionDataAttachmentOption;

/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
Expand All @@ -118,6 +125,7 @@ export interface APIChatInputApplicationCommandInteractionDataResolved {
roles?: Record<Snowflake, APIRole>;
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
channels?: Record<Snowflake, APIInteractionDataResolvedChannel>;
attachments?: Record<Snowflake, APIAttachment>;
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { Snowflake } from '../../../../../globals';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base';
import type { ApplicationCommandOptionType } from './shared';

export type APIApplicationCommandAttachmentOption =
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;

export type APIApplicationCommandInteractionDataAttachmentOption = APIInteractionDataOptionBase<
ApplicationCommandOptionType.Attachment,
Snowflake
>;
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const enum ApplicationCommandOptionType {
Role,
Mentionable,
Number,
Attachment,
}

/**
Expand Down
14 changes: 11 additions & 3 deletions payloads/v8/_interactions/_applicationCommands/chatInput.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Snowflake } from '../../../../globals';
import type { APIRole, APIUser } from '../../index';
import type { APIAttachment, APIRole, APIUser } from '../../index';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedChannel,
Expand Down Expand Up @@ -41,6 +41,10 @@ import type {
APIApplicationCommandNumberOption,
APIApplicationCommandInteractionDataNumberOption,
} from './_chatInput/number';
import type {
APIApplicationCommandAttachmentOption,
APIApplicationCommandInteractionDataAttachmentOption,
} from './_chatInput/attachment';
import type {
APIApplicationCommandSubcommandOption,
APIApplicationCommandInteractionDataSubcommandOption,
Expand All @@ -58,6 +62,7 @@ export * from './_chatInput/channel';
export * from './_chatInput/role';
export * from './_chatInput/mentionable';
export * from './_chatInput/number';
export * from './_chatInput/attachment';
export * from './_chatInput/subcommand';
export * from './_chatInput/subcommandGroup';
export * from './_chatInput/shared';
Expand All @@ -73,7 +78,8 @@ export type APIApplicationCommandBasicOption =
| APIApplicationCommandChannelOption
| APIApplicationCommandRoleOption
| APIApplicationCommandMentionableOption
| APIApplicationCommandNumberOption;
| APIApplicationCommandNumberOption
| APIApplicationCommandAttachmentOption;

/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
Expand All @@ -99,7 +105,8 @@ export type APIApplicationCommandInteractionDataBasicOption =
| APIApplicationCommandInteractionDataChannelOption
| APIApplicationCommandInteractionDataRoleOption
| APIApplicationCommandInteractionDataMentionableOption
| APIApplicationCommandInteractionDataNumberOption;
| APIApplicationCommandInteractionDataNumberOption
| APIApplicationCommandInteractionDataAttachmentOption;

/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
Expand All @@ -118,6 +125,7 @@ export interface APIChatInputApplicationCommandInteractionDataResolved {
roles?: Record<Snowflake, APIRole>;
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
channels?: Record<Snowflake, APIInteractionDataResolvedChannel>;
attachments?: Record<Snowflake, APIAttachment>;
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { Snowflake } from '../../../../../globals';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base';
import type { ApplicationCommandOptionType } from './shared';

export type APIApplicationCommandAttachmentOption =
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;

export type APIApplicationCommandInteractionDataAttachmentOption = APIInteractionDataOptionBase<
ApplicationCommandOptionType.Attachment,
Snowflake
>;
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const enum ApplicationCommandOptionType {
Role,
Mentionable,
Number,
Attachment,
}

/**
Expand Down
14 changes: 11 additions & 3 deletions payloads/v9/_interactions/_applicationCommands/chatInput.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Snowflake } from '../../../../globals';
import type { APIRole, APIUser } from '../../index';
import type { APIAttachment, APIRole, APIUser } from '../../index';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedChannel,
Expand Down Expand Up @@ -41,6 +41,10 @@ import type {
APIApplicationCommandNumberOption,
APIApplicationCommandInteractionDataNumberOption,
} from './_chatInput/number';
import type {
APIApplicationCommandAttachmentOption,
APIApplicationCommandInteractionDataAttachmentOption,
} from './_chatInput/attachment';
import type {
APIApplicationCommandSubcommandOption,
APIApplicationCommandInteractionDataSubcommandOption,
Expand All @@ -58,6 +62,7 @@ export * from './_chatInput/channel';
export * from './_chatInput/role';
export * from './_chatInput/mentionable';
export * from './_chatInput/number';
export * from './_chatInput/attachment';
export * from './_chatInput/subcommand';
export * from './_chatInput/subcommandGroup';
export * from './_chatInput/shared';
Expand All @@ -73,7 +78,8 @@ export type APIApplicationCommandBasicOption =
| APIApplicationCommandChannelOption
| APIApplicationCommandRoleOption
| APIApplicationCommandMentionableOption
| APIApplicationCommandNumberOption;
| APIApplicationCommandNumberOption
| APIApplicationCommandAttachmentOption;

/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
Expand All @@ -99,7 +105,8 @@ export type APIApplicationCommandInteractionDataBasicOption =
| APIApplicationCommandInteractionDataChannelOption
| APIApplicationCommandInteractionDataRoleOption
| APIApplicationCommandInteractionDataMentionableOption
| APIApplicationCommandInteractionDataNumberOption;
| APIApplicationCommandInteractionDataNumberOption
| APIApplicationCommandInteractionDataAttachmentOption;

/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
Expand All @@ -118,6 +125,7 @@ export interface APIChatInputApplicationCommandInteractionDataResolved {
roles?: Record<Snowflake, APIRole>;
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
channels?: Record<Snowflake, APIInteractionDataResolvedChannel>;
attachments?: Record<Snowflake, APIAttachment>;
}

/**
Expand Down