Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Remove data conditional check#11250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Jiralite wants to merge1 commit intomain
base:main
Choose a base branch
Loading
fromfix/data-removal
Open

Conversation

@Jiralite
Copy link
Member

These should never be constructed without data...

The blame seems to go years and years back. Was likely ancient logic made redundant over time.

@vercel
Copy link

vercelbot commentedNov 5, 2025

The latest updates on your projects. Learn more aboutVercel for GitHub.

2 Skipped Deployments
ProjectDeploymentPreviewCommentsUpdated (UTC)
discord-jsIgnoredIgnoredNov 5, 2025 6:08pm
discord-js-guideIgnoredIgnoredNov 5, 2025 6:08pm

Copy link

CopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes the conditionalif (data) checks before calling_patch(data) in the constructors of multiple structures includingWebhook,ThreadChannel,Role,PermissionOverwrites, andGuildMember. The changes standardize the initialization pattern by always calling_patch regardless of whether data is provided.

  • Removes conditional data checks before_patch() calls in constructors
  • Affects 5 structure classes: Webhook, ThreadChannel, Role, PermissionOverwrites, and GuildMember

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
FileDescription
packages/discord.js/src/structures/Webhook.jsRemovesif (data) check before calling_patch(data) in constructor
packages/discord.js/src/structures/ThreadChannel.jsRemovesif (data) check before calling_patch(data) in constructor
packages/discord.js/src/structures/Role.jsRemovesif (data) check before calling_patch(data) in constructor
packages/discord.js/src/structures/PermissionOverwrites.jsRemovesif (data) check before calling_patch(data) in constructor
packages/discord.js/src/structures/GuildMember.jsRemovesif (data) check before calling_patch(data) in constructor
Comments suppressed due to low confidence (1)

packages/discord.js/src/structures/ThreadChannel.js:43

  • The constructor accessesdata.owner_id directly on line 43 before calling_patch. With the removedif (data) check, ifdata is null or undefined, this will throw a TypeError. The same issue exists on line 36 withdata.guild_id. Either restore the conditional check or add null/undefined handling in the constructor.
    this.ownerId = data.owner_id;

💡Add Copilot custom instructions for smarter, more guided reviews.Learn how to get started.

@vakiliner
Copy link
Contributor

vakiliner commentedNov 5, 2025
edited
Loading

Even though these constructors are private, typings needs to be updated

privateconstructor(guild:Guild,data?:RawThreadChannelData,client?:Client<true>);

privateconstructor(client:Client<true>,data?:unknown);

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

@vladfranguvladfranguAwaiting requested review from vladfranguvladfrangu is a code owner automatically assigned from discordjs/core

@iCrawliCrawlAwaiting requested review from iCrawliCrawl is a code owner automatically assigned from discordjs/core

@kyranetkyranetAwaiting requested review from kyranetkyranet is a code owner automatically assigned from discordjs/core

@SpaceEECSpaceEECAwaiting requested review from SpaceEECSpaceEEC is a code owner automatically assigned from discordjs/core

At least 3 approving reviews are required to merge this pull request.

Assignees

No one assigned

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants

@Jiralite@vakiliner

[8]ページ先頭

©2009-2025 Movatter.jp