20 lines
341 B
JavaScript
20 lines
341 B
JavaScript
|
class Channels {
|
||
|
constructor(client) {
|
||
|
this.client = client;
|
||
|
}
|
||
|
|
||
|
async createChannel(users_id) {
|
||
|
console.log(users_id);
|
||
|
let response = await this.client._post("/api/chat/", {
|
||
|
users_id:users_id
|
||
|
});
|
||
|
|
||
|
let data = await response.json();
|
||
|
if (data == "Channel already exist")
|
||
|
return null;
|
||
|
return data;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export {Channels}
|