Merge pull request #287 from Rgoplay/fix-switching-acc-missing-channel

Added response code verification when loading a new channel
This commit is contained in:
Mathium05
2026-03-02 19:17:29 -06:00
committed by GitHub
+11 -6
View File
@@ -1701,12 +1701,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);
}