Skip to content

Commit

Permalink
fix(APIMessage): correct type for application
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This removes the `APIMessageApplication` interface, as it has
been removed from the documentation, being replaced with the OAuth2 application.

Reference: discord/discord-api-docs@ff0c831
  • Loading branch information
vladfrangu committed Apr 10, 2021
1 parent edfe70a commit ed2cbe8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 58 deletions.
29 changes: 2 additions & 27 deletions deno/payloads/v8/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIPartialEmoji } from './emoji.ts';
import type { APIGuildMember } from './guild.ts';
import type { APIMessageInteraction } from './interactions.ts';
import { APIApplication } from './oauth2.ts';
import type { APIRole } from './permissions.ts';
import type { APIUser } from './user.ts';

Expand Down Expand Up @@ -302,7 +303,7 @@ export interface APIMessage {
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
*/
application?: APIMessageApplication;
application?: Partial<APIApplication>;
/**
* Reference data sent with crossposted messages and replies
*
Expand Down Expand Up @@ -387,32 +388,6 @@ export interface APIMessageActivity {
party_id?: string;
}

/**
* https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
*/
export interface APIMessageApplication {
/**
* ID of the application
*/
id: Snowflake;
/**
* ID of the embed's image asset
*/
cover_image?: string;
/**
* Application's description
*/
description: string;
/**
* ID of the application's icon
*/
icon: string | null;
/**
* Name of the application
*/
name: string;
}

/**
* https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
*/
Expand Down
8 changes: 4 additions & 4 deletions deno/payloads/v8/interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ export interface APIApplicationCommandInteractionData {
name: string;
options?: APIApplicationCommandInteractionDataOption[];
resolved?: {
users?: Record<string, APIUser>;
roles?: Record<string, APIRole>;
members?: Record<string, Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> & { permissions: Permissions }>;
channels?: Record<string, Required<APIPartialChannel> & { permissions: Permissions }>;
users?: Record<Snowflake, APIUser>;
roles?: Record<Snowflake, APIRole>;
members?: Record<Snowflake, Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> & { permissions: Permissions }>;
channels?: Record<Snowflake, Required<APIPartialChannel> & { permissions: Permissions }>;
};
}

Expand Down
29 changes: 2 additions & 27 deletions payloads/v8/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { Permissions, Snowflake } from '../../globals';
import type { APIPartialEmoji } from './emoji';
import type { APIGuildMember } from './guild';
import type { APIMessageInteraction } from './interactions';
import { APIApplication } from './oauth2';
import type { APIRole } from './permissions';
import type { APIUser } from './user';

Expand Down Expand Up @@ -302,7 +303,7 @@ export interface APIMessage {
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
*/
application?: APIMessageApplication;
application?: Partial<APIApplication>;
/**
* Reference data sent with crossposted messages and replies
*
Expand Down Expand Up @@ -387,32 +388,6 @@ export interface APIMessageActivity {
party_id?: string;
}

/**
* https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
*/
export interface APIMessageApplication {
/**
* ID of the application
*/
id: Snowflake;
/**
* ID of the embed's image asset
*/
cover_image?: string;
/**
* Application's description
*/
description: string;
/**
* ID of the application's icon
*/
icon: string | null;
/**
* Name of the application
*/
name: string;
}

/**
* https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
*/
Expand Down

0 comments on commit ed2cbe8

Please sign in to comment.