chat: fix the core update

This commit is contained in:
2024-01-09 13:17:41 +01:00
parent 0c59dd4005
commit 5bc847ad88
2 changed files with 31 additions and 45 deletions

View File

@ -8,28 +8,19 @@ class Channels {
async createChannel(members_id, reload) {
let null_id = false;
members_id.forEach(member_id => {
if (member_id == null)
null_id = true;
});
if (null_id)
return console.log(members_id, "createChannel error, null id;");
let response = await this.client._post("/api/chat/", {
members_id:members_id
});
let data = await response.json();
if (data.status >= 300)
if (response.status >= 300)
return undefined;
let data = await response.json();
let messages = undefined;
if (exit_code == 200)
if (response.status == 200)
messages = data.messages;
console.log(response);
console.log(data);
this.channel = new Channel(this.client, data.channel_id, members_id, messages, reload);
return this.channel;
}