fix: Remove data conditional check (#11250)

* fix: remove conditional

* types: sort types
This commit is contained in:
Jiralite
2025-11-12 13:31:13 +00:00
parent 33bfdedf35
commit 84197a0ee0
6 changed files with 7 additions and 7 deletions

View File

@@ -56,7 +56,7 @@ class GuildMember extends Base {
*/
Object.defineProperty(this, '_roles', { value: [], writable: true });
if (data) this._patch(data);
this._patch(data);
}
_patch(data) {

View File

@@ -22,7 +22,7 @@ class PermissionOverwrites extends Base {
*/
Object.defineProperty(this, 'channel', { value: channel });
if (data) this._patch(data);
this._patch(data);
}
_patch(data) {

View File

@@ -34,7 +34,7 @@ class Role extends Base {
*/
this.unicodeEmoji = null;
if (data) this._patch(data);
this._patch(data);
}
_patch(data) {

View File

@@ -49,7 +49,7 @@ class ThreadChannel extends BaseChannel {
* @type {ThreadMemberManager}
*/
this.members = new ThreadMemberManager(this);
if (data) this._patch(data);
this._patch(data);
}
_patch(data) {

View File

@@ -22,7 +22,7 @@ class Webhook {
* @readonly
*/
Object.defineProperty(this, 'client', { value: client });
if (data) this._patch(data);
this._patch(data);
}
_patch(data) {

View File

@@ -3841,7 +3841,7 @@ export interface PrivateThreadChannel extends ThreadChannel<false> {
export interface ThreadChannel<ThreadOnly extends boolean = boolean>
extends Omit<TextBasedChannelFields<true>, 'fetchWebhooks' | 'createWebhook' | 'setNSFW'> {}
export class ThreadChannel<ThreadOnly extends boolean = boolean> extends BaseChannel {
private constructor(guild: Guild, data?: RawThreadChannelData, client?: Client<true>);
private constructor(guild: Guild, data: RawThreadChannelData, client?: Client<true>);
public archived: boolean | null;
public get archivedAt(): Date | null;
public archiveTimestamp: number | null;
@@ -4234,7 +4234,7 @@ export class VoiceState extends Base {
// tslint:disable-next-line no-empty-interface
export interface Webhook<Type extends WebhookType = WebhookType> extends WebhookFields {}
export class Webhook<Type extends WebhookType = WebhookType> {
private constructor(client: Client<true>, data?: RawWebhookData);
private constructor(client: Client<true>, data: RawWebhookData);
public avatar: string | null;
public avatarURL(options?: ImageURLOptions): string | null;
public channelId: Snowflake;