Skip to content

Commit

Permalink
feat(APIApplicationCommandInteractionData): add guild_id (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladfrangu committed Apr 4, 2022
1 parent 279bf67 commit bc6e97f
Show file tree
Hide file tree
Showing 186 changed files with 2,204 additions and 2,601 deletions.
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"files.eol": "\n",
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"editor.codeActionsOnSave": {
"source.organizeImports": false,
"source.fixAll": true,
"source.fixAll.eslint": true
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';

export type APIApplicationCommandAttachmentOption =
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { LocalizationMap } from '../../../../../v10.ts';
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
import type { LocalizationMap } from '../../../../../v10.ts';

export interface APIApplicationCommandOptionBase<Type extends ApplicationCommandOptionType> {
type: Type;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { ChannelType } from '../../../channel.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
import type { ChannelType } from '../../../channel.ts';

export interface APIApplicationCommandChannelOption
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Channel> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';

export type APIApplicationCommandMentionableOption =
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Mentionable>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';

export type APIApplicationCommandRoleOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.Role>;

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

export interface APIApplicationCommandSubcommandOption
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Subcommand> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';

export type APIApplicationCommandUserOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.User>;

Expand Down
20 changes: 10 additions & 10 deletions deno/payloads/v10/_interactions/_applicationCommands/chatInput.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
import type { Snowflake } from '../../../../globals.ts';
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedChannel,
APIInteractionDataResolvedGuildMember,
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type {
APIApplicationCommandAttachmentOption,
APIApplicationCommandInteractionDataAttachmentOption,
Expand Down Expand Up @@ -52,6 +42,16 @@ import type {
APIApplicationCommandInteractionDataUserOption,
APIApplicationCommandUserOption,
} from './_chatInput/user.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type { Snowflake } from '../../../../globals.ts';
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedChannel,
APIInteractionDataResolvedGuildMember,
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';

export * from './_chatInput/attachment.ts';
export * from './_chatInput/boolean.ts';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type { Snowflake } from '../../../../globals.ts';
import type { APIMessage } from '../../channel.ts';
import type { APIUser } from '../../user.ts';
Expand All @@ -7,7 +8,6 @@ import type {
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';

/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export interface APIBaseApplicationCommandInteractionData<Type extends Applicati
id: Snowflake;
type: Type;
name: string;
guild_id?: Snowflake;
}
12 changes: 6 additions & 6 deletions deno/payloads/v10/_interactions/applicationCommands.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { LocalizationMap } from '../../../v10.ts';
import type { APIPartialChannel, APIThreadMetadata } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
import type {
APIApplicationCommandOption,
APIChatInputApplicationCommandDMInteraction,
Expand All @@ -17,6 +11,12 @@ import type {
APIContextMenuInteraction,
APIContextMenuInteractionData,
} from './_applicationCommands/contextMenu.ts';
import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { LocalizationMap } from '../../../v10.ts';
import type { APIPartialChannel, APIThreadMetadata } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';

export * from './_applicationCommands/chatInput.ts';
export * from './_applicationCommands/contextMenu.ts';
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v10/_interactions/base.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { InteractionType } from './responses.ts';
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { LocaleString } from '../../../v10.ts';
import type { APIMessage } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
import type { APIUser } from '../user.ts';
import type { InteractionType } from './responses.ts';

export type PartialAPIMessageInteractionGuildMember = Pick<
APIGuildMember,
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v10/_interactions/messageComponents.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
import type { ComponentType } from '../channel.ts';
import type { APIBaseInteraction, InteractionType } from '../interactions.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';

export type APIMessageComponentInteraction = APIBaseInteraction<
InteractionType.MessageComponent,
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v10/_interactions/responses.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v10.ts';
import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel.ts';
import type { MessageFlags } from '../mod.ts';
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';

/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v10/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* Types extracted from https://discord.com/developers/docs/resources/application
*/

import type { Permissions, Snowflake } from '../../globals.ts';
import type { OAuth2Scopes } from './oauth2.ts';
import type { APITeam } from './teams.ts';
import type { APIUser } from './user.ts';
import type { Permissions, Snowflake } from '../../globals.ts';

/**
* https://discord.com/developers/docs/resources/application#application-object
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v10/auditLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Types extracted from https://discord.com/developers/docs/resources/audit-log
*/

import type { Snowflake } from '../../globals.ts';
import type { APIChannel, APIOverwrite } from './channel.ts';
import type {
APIGuildIntegration,
Expand All @@ -22,6 +21,7 @@ import type { StageInstancePrivacyLevel } from './stageInstance.ts';
import type { StickerFormatType } from './sticker.ts';
import type { APIUser } from './user.ts';
import type { APIWebhook } from './webhook.ts';
import type { Snowflake } from '../../globals.ts';

/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
* Types extracted from https://discord.com/developers/docs/resources/channel
*/

import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIApplication } from './application.ts';
import type { APIPartialEmoji } from './emoji.ts';
import type { APIGuildMember } from './guild.ts';
import type { APIMessageInteraction } from './interactions.ts';
import type { APIRole } from './permissions.ts';
import type { APISticker, APIStickerItem } from './sticker.ts';
import type { APIUser } from './user.ts';
import type { Permissions, Snowflake } from '../../globals.ts';

/**
* Not documented, but partial only includes id, name, and type
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v10/emoji.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* Types extracted from https://discord.com/developers/docs/resources/emoji
*/

import type { Snowflake } from '../../globals.ts';
import type { APIRole } from './permissions.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';

/**
* Not documented but mentioned
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v10/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* Types extracted from https://discord.com/developers/docs/topics/gateway
*/

import type { Snowflake } from '../../globals.ts';
import type { APIChannel, APIThreadMember } from './channel.ts';
import type { APIEmoji } from './emoji.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';

/**
* https://discord.com/developers/docs/topics/gateway#get-gateway
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v10/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Types extracted from https://discord.com/developers/docs/resources/guild
*/

import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIChannel } from './channel.ts';
import type { APIEmoji } from './emoji.ts';
import type { GatewayPresenceUpdate, PresenceUpdateStatus } from './gateway.ts';
Expand All @@ -12,6 +11,7 @@ import type { APIStageInstance } from './stageInstance.ts';
import type { APISticker } from './sticker.ts';
import type { APIUser } from './user.ts';
import type { GatewayVoiceState } from './voice.ts';
import type { Permissions, Snowflake } from '../../globals.ts';

/**
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v10/guildScheduledEvent.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Snowflake } from '../../globals.ts';
import type { APIGuildMember } from './guild.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';

interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType> {
/**
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v10/stageInstance.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import type { APIGuildMember } from './guild.ts';
import type { Snowflake } from '../../globals.ts';

/**
* https://discord.com/developers/docs/resources/stage-instance#stage-instance-object
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v10/sticker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/resources/sticker
*/

import type { Snowflake } from '../../globals.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';

/**
* https://discord.com/developers/docs/resources/sticker#sticker-object
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v10/teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/topics/teams
*/

import type { Snowflake } from '../../globals.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';

/**
* https://discord.com/developers/docs/topics/teams#data-models-team-object
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v10/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* Types extracted from https://discord.com/developers/docs/resources/template
*/

import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
import type { RESTPostAPIGuildsJSONBody } from '../../rest/v10/mod.ts';
import type { APIUser } from './user.ts';

/**
* https://discord.com/developers/docs/resources/template#template-object
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v10/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/resources/user
*/

import type { Snowflake } from '../../globals.ts';
import type { APIGuildIntegration } from './guild.ts';
import type { Snowflake } from '../../globals.ts';

/**
* https://discord.com/developers/docs/resources/user#user-object
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v10/voice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/resources/voice
*/

import type { Snowflake } from '../../globals.ts';
import type { APIGuildMember } from './guild.ts';
import type { Snowflake } from '../../globals.ts';

/**
* https://discord.com/developers/docs/resources/voice#voice-state-object
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v10/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/resources/webhook
*/

import type { Snowflake } from '../../globals.ts';
import type { APIPartialChannel, APIPartialGuild, APIUser } from './mod.ts';
import type { Snowflake } from '../../globals.ts';

/**
* https://discord.com/developers/docs/resources/webhook#webhook-object
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';

/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { ChannelType } from '../../../channel.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
import type { ChannelType } from '../../../channel.ts';

/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';

/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';

/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
import type { APIApplicationCommandOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';

/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';

/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
Expand Down
Loading

0 comments on commit bc6e97f

Please sign in to comment.