Skip to content

Conversation

Copy link

Copilot AI commented Nov 25, 2025

Please describe the changes this PR makes and why it should be merged:

The title field documentation was too vague ("The title of the file"). Updated to clarify:

  • title preserves the original filename with special characters (e.g., Cyrillic) intact
  • title is present when the filename contains special characters
  • filename is the sanitized version without those special characters

Updated in both payloads/v9/message.ts and payloads/v10/message.ts.

If applicable, please reference Discord API Docs PRs or commits that influenced this PR:

discord/discord-api-docs#6945

Original prompt

This section details on the original issue you should resolve

<issue_title>Attachment titles should clarify their distinction</issue_title>
<issue_description>### Feature

Per discord/discord-api-docs#6945:

This will be present when a filename contains special characters (ie, cyrillic alphabet).

Right now, title just says this:

/**
* Name of file attached
*/
filename: string;
/**
* The title of the file
*/
title?: string;

That's a pretty lacklustre detail for such a crucial differentiation. Let's update it.

Ideal solution or implementation

Clarify when title is present and its differentiation from filename.

Alternative solutions or implementations

No response

Other context

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link

vercel bot commented Nov 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
discord-api-types Ready Ready Preview Comment Nov 25, 2025 8:38pm

Copilot AI changed the title [WIP] Clarify attachment titles for better distinction docs(APIAttachment): clarify title field distinction from filename Nov 25, 2025
Copilot AI requested a review from Jiralite November 25, 2025 20:19
Copilot finished work on behalf of Jiralite November 25, 2025 20:19
@Jiralite
Copy link
Member

@copilot The description seems to contradict itself.

filename is the sanitised variant and title is present when there are special characters (it preserves the original name).

@almeidx
Copy link
Member

almeidx commented Nov 25, 2025

@copilot You have to run yarn build:deno and stage the changes made to the deno folder.
Usually this would have been done by the pre-commit hook.

Copy link
Author

Copilot AI commented Nov 25, 2025

@copilot The description seems to contradict itself.

filename is the sanitised variant and title is present when there are special characters (it preserves the original name).

Fixed in dfd3b97. Updated the documentation to correctly indicate that title preserves the original filename with special characters, while filename is the sanitized version.

Copilot finished work on behalf of Jiralite November 25, 2025 20:26
Copy link
Author

Copilot AI commented Nov 25, 2025

@copilot You have to run yarn build:deno and stage the changes made to the deno folder.
Usually this would have been done by the pre-commit hook.

Done in fc8ece5. Ran yarn build:deno and committed the generated deno folder changes.

Copilot AI requested a review from almeidx November 25, 2025 20:29
Copilot finished work on behalf of almeidx November 25, 2025 20:29
@almeidx almeidx marked this pull request as ready for review November 25, 2025 21:11
@almeidx almeidx requested a review from a team as a code owner November 25, 2025 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Attachment titles should clarify their distinction

3 participants