From 52b177fe75e9259427583e2d78c2c652b37857f5 Mon Sep 17 00:00:00 2001 From: Rgoplay <52797377+Rgoplay@users.noreply.github.com> Date: Thu, 19 Feb 2026 21:44:26 +0100 Subject: [PATCH] Added response code verification when adding a new channel --- src/webpage/guild.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/webpage/guild.ts b/src/webpage/guild.ts index 2914cd15..97d75c01 100644 --- a/src/webpage/guild.ts +++ b/src/webpage/guild.ts @@ -1700,12 +1700,17 @@ class Guild extends SnowFlake { await fetch(this.info.api + "/channels/" + threadId, { headers: this.headers, }) - ).json()) as channeljson; - const channel = new Channel(channelJson, this); - this.localuser.channelids.set(channel.id, channel); - channel.resolveparent(this); - const par = this.localuser.channelids.get(channel.parent_id as string); - par?.createguildHTML(); + ).json()); + if(channelJson.code == 200){ + const channel = new Channel(channelJson as channeljson, this); + this.localuser.channelids.set(channel.id, channel); + channel.resolveparent(this); + const par = this.localuser.channelids.get(channel.parent_id as string); + par?.createguildHTML(); + } else { + this.loadChannel(); + } + } this.localuser.goToChannel(threadId); }