Skip to content

Conversation

Qjuh
Copy link
Member

@Qjuh Qjuh commented Jul 12, 2025

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

Status and versioning classification:

Copy link

vercel bot commented Jul 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Jul 15, 2025 3:00pm
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Jul 15, 2025 3:00pm

Copy link

codecov bot commented Jul 12, 2025

Codecov Report

❌ Patch coverage is 50.93867% with 392 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.49%. Comparing base (3cff4d7) to head (818d975).
⚠️ Report is 36 commits behind head on main.

Files with missing lines Patch % Lines
packages/structures/src/messages/Attachment.ts 39.21% 31 Missing ⚠️
packages/structures/src/messages/embeds/Embed.ts 3.84% 25 Missing ⚠️
...ges/structures/src/messages/InteractionMetadata.ts 4.34% 22 Missing ⚠️
...tures/src/messages/components/UnfurledMediaItem.ts 42.10% 22 Missing ⚠️
...s/structures/src/messages/embeds/EmbedThumbnail.ts 4.76% 20 Missing ⚠️
...ages/structures/src/messages/embeds/EmbedAuthor.ts 5.00% 19 Missing ⚠️
...kages/structures/src/messages/embeds/EmbedImage.ts 5.00% 19 Missing ⚠️
...kages/structures/src/messages/embeds/EmbedVideo.ts 5.00% 19 Missing ⚠️
...res/src/messages/components/TextInputCompoinent.ts 43.75% 18 Missing ⚠️
...kages/structures/src/messages/embeds/EmbedField.ts 5.88% 16 Missing ⚠️
... and 32 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10982      +/-   ##
==========================================
+ Coverage   45.23%   45.49%   +0.25%     
==========================================
  Files         307      352      +45     
  Lines       17189    17988     +799     
  Branches     1747     1752       +5     
==========================================
+ Hits         7776     8183     +407     
- Misses       9400     9792     +392     
  Partials       13       13              
Flag Coverage Δ
structures 70.84% <50.93%> (-14.36%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@ckohen ckohen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looking pretty good, some docstring errors and a couple things to discuss so far.

Also overall discussion, should we doc every param like types and kinda mainlib do rn. So many of them are very self-explanatory (especially the substructure ones) but I think we probably should do a lot of it anyways?

Comment on lines +18 to +19
export * from './TextDisplayCompoinent.js';
export * from './TextInputCompoinent.js';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export * from './TextDisplayCompoinent.js';
export * from './TextInputCompoinent.js';
export * from './TextDisplayComponent.js';
export * from './TextInputComponent.js';

filename typos

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in the name

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in the name

: APIBaseComponent<ComponentType>;
export class Component<
Type extends APIMessageComponent | APIModalComponent,
Omitted extends keyof Type | '' = '',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the base component, but at least for the rest of them we should be overriding the static DataTemplate for type purposes

I suppose you could want to not store something on any components, but not sure if the tighter type would help that.

Omitted extends keyof APIActionRowComponent<Type> | '' = '',
> extends Component<ComponentDataType<ComponentType.ActionRow>, Omitted> {
/**
* @param data - The raw data received from the API for the connection
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a connection (everywhere)

super(data as InteractionMetadataType<Type>);
}

public get authorizingIntegrationOwner(): Readonly<APIAuthorizingIntegrationOwnersMap> | null {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

torn on this one

/**
* The user ids that participated in this call
*/
public get participants(): readonly string[] | null {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets discuss

public static override DataTemplate: Partial<APIMessageMentions> = {
set mentions(_: APIUser[]) {},
set mention_channels(_: APIChannelMention[]) {},
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we defaulting removing these?

* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
* @remarks has substructures `MentionChannel`, `User` which need to be instantiated and stored by an extending class using it
*/
export class MessageMentions<Omitted extends keyof APIMessageMentions | '' = ''> extends Structure<
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this class exist? These all seem to be properties of message directly on discord's side. I guess we probably make everything under mentions in discord.js but I don't think we should do that here. (Also everything in this structure is an array that would probably be replaced by a cache-level accessor for the respective ids)

>;

/**
* Represents video data in an embed on a message.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nop (all the metadatas)

@github-project-automation github-project-automation bot moved this from Todo to Review in Progress in discord.js Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Review in Progress
Development

Successfully merging this pull request may close these issues.

2 participants