Skip to content

Commit

Permalink
feat(RESTAPIAttachment): add more properties
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidx authored Aug 23, 2024
1 parent 3aee5c4 commit fdb4ba4
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 64 deletions.
6 changes: 3 additions & 3 deletions deno/payloads/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ export interface APIMessage {
/**
* Any attached files
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
*
Expand Down Expand Up @@ -1415,7 +1415,7 @@ export interface APIEmbedField {
}

/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure-attachment-structure
*/
export interface APIAttachment {
/**
Expand Down Expand Up @@ -1479,7 +1479,7 @@ export interface APIAttachment {
}

/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure-attachment-flags
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure-attachment-structure-attachment-flags
*/
export enum AttachmentFlags {
/**
Expand Down
6 changes: 3 additions & 3 deletions deno/payloads/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ export interface APIMessage {
/**
* Any attached files
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
*
Expand Down Expand Up @@ -1382,7 +1382,7 @@ export interface APIEmbedField {
}

/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure-attachment-structure
*/
export interface APIAttachment {
/**
Expand Down Expand Up @@ -1446,7 +1446,7 @@ export interface APIAttachment {
}

/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure-attachment-flags
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure-attachment-structure-attachment-flags
*/
export enum AttachmentFlags {
/**
Expand Down
19 changes: 7 additions & 12 deletions deno/rest/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import type {
SortOrderType,
ForumLayoutType,
ChannelFlags,
APIAttachment,
} from '../../payloads/v10/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
import type { RESTAPIPoll } from './poll.ts';
Expand Down Expand Up @@ -260,22 +261,16 @@ export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesO
export type APIMessageReferenceSend = RESTAPIMessageReference;

/**
* https://discord.com/developers/docs/resources/channel#attachment-object
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export interface RESTAPIAttachment {
export type RESTAPIAttachment = Partial<
Pick<APIAttachment, 'description' | 'duration_secs' | 'filename' | 'title' | 'waveform'>
> & {
/**
* Attachment id or a number that matches `n` in `files[n]`
*/
id: Snowflake | number;
/**
* Name of the file
*/
filename?: string | undefined;
/**
* Description of the file
*/
description?: string | undefined;
}
};

/**
* https://discord.com/developers/docs/resources/channel#create-message
Expand Down Expand Up @@ -461,7 +456,7 @@ export interface RESTPatchAPIChannelMessageJSONBody {
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
/**
Expand Down
2 changes: 1 addition & 1 deletion deno/rest/v10/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
};
Expand Down
19 changes: 7 additions & 12 deletions deno/rest/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import type {
SortOrderType,
ForumLayoutType,
ChannelFlags,
APIAttachment,
} from '../../payloads/v9/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
import type { RESTAPIPoll } from './poll.ts';
Expand Down Expand Up @@ -260,22 +261,16 @@ export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesO
export type APIMessageReferenceSend = RESTAPIMessageReference;

/**
* https://discord.com/developers/docs/resources/channel#attachment-object
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export interface RESTAPIAttachment {
export type RESTAPIAttachment = Partial<
Pick<APIAttachment, 'description' | 'duration_secs' | 'filename' | 'title' | 'waveform'>
> & {
/**
* Attachment id or a number that matches `n` in `files[n]`
*/
id: Snowflake | number;
/**
* Name of the file
*/
filename?: string | undefined;
/**
* Description of the file
*/
description?: string | undefined;
}
};

/**
* https://discord.com/developers/docs/resources/channel#create-message
Expand Down Expand Up @@ -477,7 +472,7 @@ export interface RESTPatchAPIChannelMessageJSONBody {
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
/**
Expand Down
2 changes: 1 addition & 1 deletion deno/rest/v9/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
};
Expand Down
6 changes: 3 additions & 3 deletions payloads/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ export interface APIMessage {
/**
* Any attached files
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
*
Expand Down Expand Up @@ -1415,7 +1415,7 @@ export interface APIEmbedField {
}

/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure-attachment-structure
*/
export interface APIAttachment {
/**
Expand Down Expand Up @@ -1479,7 +1479,7 @@ export interface APIAttachment {
}

/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure-attachment-flags
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure-attachment-structure-attachment-flags
*/
export enum AttachmentFlags {
/**
Expand Down
6 changes: 3 additions & 3 deletions payloads/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ export interface APIMessage {
/**
* Any attached files
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
*
Expand Down Expand Up @@ -1382,7 +1382,7 @@ export interface APIEmbedField {
}

/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure-attachment-structure
*/
export interface APIAttachment {
/**
Expand Down Expand Up @@ -1446,7 +1446,7 @@ export interface APIAttachment {
}

/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure-attachment-flags
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure-attachment-structure-attachment-flags
*/
export enum AttachmentFlags {
/**
Expand Down
19 changes: 7 additions & 12 deletions rest/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import type {
SortOrderType,
ForumLayoutType,
ChannelFlags,
APIAttachment,
} from '../../payloads/v10/index';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals';
import type { RESTAPIPoll } from './poll';
Expand Down Expand Up @@ -260,22 +261,16 @@ export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesO
export type APIMessageReferenceSend = RESTAPIMessageReference;

/**
* https://discord.com/developers/docs/resources/channel#attachment-object
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export interface RESTAPIAttachment {
export type RESTAPIAttachment = Partial<
Pick<APIAttachment, 'description' | 'duration_secs' | 'filename' | 'title' | 'waveform'>
> & {
/**
* Attachment id or a number that matches `n` in `files[n]`
*/
id: Snowflake | number;
/**
* Name of the file
*/
filename?: string | undefined;
/**
* Description of the file
*/
description?: string | undefined;
}
};

/**
* https://discord.com/developers/docs/resources/channel#create-message
Expand Down Expand Up @@ -461,7 +456,7 @@ export interface RESTPatchAPIChannelMessageJSONBody {
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
/**
Expand Down
2 changes: 1 addition & 1 deletion rest/v10/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
};
Expand Down
19 changes: 7 additions & 12 deletions rest/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import type {
SortOrderType,
ForumLayoutType,
ChannelFlags,
APIAttachment,
} from '../../payloads/v9/index';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals';
import type { RESTAPIPoll } from './poll';
Expand Down Expand Up @@ -260,22 +261,16 @@ export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesO
export type APIMessageReferenceSend = RESTAPIMessageReference;

/**
* https://discord.com/developers/docs/resources/channel#attachment-object
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export interface RESTAPIAttachment {
export type RESTAPIAttachment = Partial<
Pick<APIAttachment, 'description' | 'duration_secs' | 'filename' | 'title' | 'waveform'>
> & {
/**
* Attachment id or a number that matches `n` in `files[n]`
*/
id: Snowflake | number;
/**
* Name of the file
*/
filename?: string | undefined;
/**
* Description of the file
*/
description?: string | undefined;
}
};

/**
* https://discord.com/developers/docs/resources/channel#create-message
Expand Down Expand Up @@ -477,7 +472,7 @@ export interface RESTPatchAPIChannelMessageJSONBody {
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
/**
Expand Down
2 changes: 1 addition & 1 deletion rest/v9/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
};
Expand Down

0 comments on commit fdb4ba4

Please sign in to comment.