This commit is contained in:
2024-05-14 11:33:26 +02:00
parent ff21682310
commit 927e41cdd3
4 changed files with 30 additions and 13 deletions

View File

@ -1,11 +1,11 @@
class Ask {
export default class Ask {
constructor(client) {
this.client = client;
}
async ask_game(asked) {
response = await this.client._post(`/api/chat/ask/`, {
let response = await this.client._post(`/api/chat/ask/`, {
asked:asked,
});
}
@ -15,14 +15,28 @@ class Ask {
}
async ask_game_accepted(asker) {
response = await this.client._post(`/api/chat/ask/accept`, {
let response = await this.client._post(`/api/chat/ask/accept`, {
asker:asker,
});
console.log(response.status);
}
async ask_game_refused(asker) {
response = await this.client._delete(`/api/chat/ask/`, {
let response = await this.client._delete(`/api/chat/ask/`, {
asker:asker,
});
console.log(response.status);
}
async is_asked(asked) {
let response = await this.client._get(`/api/chat/ask/${asked}`);
const statu = response.status;
console.log(statu);
if (statu == 404 || statu == 204)
return false;
return true;
}
}

View File

@ -16,7 +16,7 @@ export default class Channels {
return undefined;
const data = await response.json();
console.log(data)
//console.log(data)
this.channel = new Channel(this.client, data.id, members_id, data.messages, reload);
}