From 94292d348b709da5a3e8205f9f5f912a10261dff Mon Sep 17 00:00:00 2001 From: Zaid Arshad Date: Tue, 28 May 2024 23:57:50 -0400 Subject: [PATCH] fix: type errors --- packages/guilded.js/lib/structures/Role.ts | 4 ++-- .../guilded.js/lib/structures/channels/Channel.ts | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/guilded.js/lib/structures/Role.ts b/packages/guilded.js/lib/structures/Role.ts index 4ec48dd8..7cda254a 100644 --- a/packages/guilded.js/lib/structures/Role.ts +++ b/packages/guilded.js/lib/structures/Role.ts @@ -38,7 +38,7 @@ export class Role extends Base<{ id: number; serverId: string }, number> { icon: string | null; /** The position of this role on the hierarchy */ - position: number; + priority: number | null; /** Whether this is the default role for members */ isBase: boolean; @@ -62,7 +62,7 @@ export class Role extends Base<{ id: number; serverId: string }, number> { this.permissions = data.permissions; this.colors = data.colors ?? []; this.icon = data.icon ?? null; - this.position = data.position; + this.priority = data.priority ?? null; this.isBase = data.isBase ?? false; this.botUserId = data.botUserId ?? null; } diff --git a/packages/guilded.js/lib/structures/channels/Channel.ts b/packages/guilded.js/lib/structures/channels/Channel.ts index 6ec7f7e3..fae98774 100644 --- a/packages/guilded.js/lib/structures/channels/Channel.ts +++ b/packages/guilded.js/lib/structures/channels/Channel.ts @@ -61,9 +61,9 @@ export class Channel extends Base { groupId: string; /** - * Whether the channel is public. + * The visibility state of the channel. */ - isPublic!: boolean; + visibility!: string | null; /** * The user ID of the user who archived the channel. @@ -77,8 +77,9 @@ export class Channel extends Base { constructor( client: Client, - data: ServerChannelPayload & { + data: Omit & { deleted?: boolean; + visibility?: "private" | "public" | "" | null; }, ) { super(client, data); @@ -114,8 +115,9 @@ export class Channel extends Base { _update( data: Partial< - ServerChannelPayload & { + Omit & { deleted?: boolean; + visibility?: "private" | "public" | "" | null; } >, ): this { @@ -139,8 +141,8 @@ export class Channel extends Base { this.categoryId = data.categoryId ?? null; } - if ("isPublic" in data && typeof data.isPublic !== "undefined") { - this.isPublic = data.isPublic ?? false; + if ("visibility" in data && typeof data.visibility !== "undefined") { + this.visibility = data.visibility; } if ("archivedBy" in data && typeof data.archivedBy !== "undefined") {