mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix: Remove data conditional check (#11250)
* fix: remove conditional * types: sort types
This commit is contained in:
@@ -61,7 +61,7 @@ class GuildMember extends Base {
|
||||
*/
|
||||
Object.defineProperty(this, '_roles', { value: [], writable: true });
|
||||
|
||||
if (data) this._patch(data);
|
||||
this._patch(data);
|
||||
}
|
||||
|
||||
_patch(data) {
|
||||
|
||||
@@ -24,7 +24,7 @@ class PermissionOverwrites extends Base {
|
||||
*/
|
||||
Object.defineProperty(this, 'channel', { value: channel });
|
||||
|
||||
if (data) this._patch(data);
|
||||
this._patch(data);
|
||||
}
|
||||
|
||||
_patch(data) {
|
||||
|
||||
@@ -38,7 +38,7 @@ class Role extends Base {
|
||||
*/
|
||||
this.unicodeEmoji = null;
|
||||
|
||||
if (data) this._patch(data);
|
||||
this._patch(data);
|
||||
}
|
||||
|
||||
_patch(data) {
|
||||
|
||||
@@ -55,7 +55,7 @@ class ThreadChannel extends BaseChannel {
|
||||
* @type {ThreadMemberManager}
|
||||
*/
|
||||
this.members = new ThreadMemberManager(this);
|
||||
if (data) this._patch(data);
|
||||
this._patch(data);
|
||||
}
|
||||
|
||||
_patch(data) {
|
||||
|
||||
@@ -23,7 +23,7 @@ class Webhook {
|
||||
* @readonly
|
||||
*/
|
||||
Object.defineProperty(this, 'client', { value: client });
|
||||
if (data) this._patch(data);
|
||||
this._patch(data);
|
||||
}
|
||||
|
||||
_patch(data) {
|
||||
|
||||
4
packages/discord.js/typings/index.d.ts
vendored
4
packages/discord.js/typings/index.d.ts
vendored
@@ -3525,7 +3525,7 @@ export interface ThreadChannel<ThreadOnly extends boolean = boolean>
|
||||
MessageChannelFields,
|
||||
SendMethod<true> {}
|
||||
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;
|
||||
@@ -3821,7 +3821,7 @@ export class VoiceState extends Base {
|
||||
|
||||
export interface Webhook<Type extends WebhookType = WebhookType> extends WebhookFields {}
|
||||
export class Webhook<Type extends WebhookType = WebhookType> {
|
||||
private constructor(client: Client<true>, data?: unknown);
|
||||
private constructor(client: Client<true>, data: unknown);
|
||||
public avatar: string | null;
|
||||
public avatarURL(options?: ImageURLOptions): string | null;
|
||||
public channelId: Snowflake;
|
||||
|
||||
Reference in New Issue
Block a user