fix API bugs
This commit is contained in:
parent
1d705a6f63
commit
01be46d5e1
8 changed files with 42 additions and 42 deletions
|
@ -493,7 +493,7 @@ class Localuser{
|
|||
}else{
|
||||
parsed=inviteurl;
|
||||
}
|
||||
fetch(this.info.api+"/v9/invites/"+parsed,{
|
||||
fetch(this.info.api+"/invites/"+parsed,{
|
||||
method:"POST",
|
||||
headers:this.headers,
|
||||
}).then(r=>r.json()).then(_=>{
|
||||
|
@ -518,7 +518,7 @@ class Localuser{
|
|||
const full=new Fullscreen(["html", content]);
|
||||
full.show();
|
||||
|
||||
const res=await fetch(this.info.api+"/v9/discoverable-guilds?limit=50", {
|
||||
const res=await fetch(this.info.api+"/discoverable-guilds?limit=50", {
|
||||
headers: this.headers
|
||||
});
|
||||
const json=await res.json();
|
||||
|
@ -562,7 +562,7 @@ class Localuser{
|
|||
content.appendChild(desc);
|
||||
|
||||
content.addEventListener("click", async ()=>{
|
||||
const joinRes=await fetch(this.info.api+"/v9/guilds/"+guild.id+"/members/@me", {
|
||||
const joinRes=await fetch(this.info.api+"/guilds/"+guild.id+"/members/@me", {
|
||||
method: "PUT",
|
||||
headers: this.headers
|
||||
});
|
||||
|
@ -637,7 +637,7 @@ class Localuser{
|
|||
});
|
||||
}
|
||||
updatebio(bio:string):void{
|
||||
fetch(this.info.api+"/v9/users/@me/profile",{
|
||||
fetch(this.info.api+"/users/@me/profile",{
|
||||
method:"PATCH",
|
||||
headers:this.headers,
|
||||
body:JSON.stringify({
|
||||
|
@ -832,7 +832,7 @@ class Localuser{
|
|||
], () => {}, async () => {
|
||||
connectionContainer.innerHTML="";
|
||||
|
||||
const res=await fetch(this.info.api+"/v9/connections", {
|
||||
const res=await fetch(this.info.api+"/connections", {
|
||||
headers: this.headers
|
||||
});
|
||||
const json=await res.json();
|
||||
|
@ -845,7 +845,7 @@ class Localuser{
|
|||
|
||||
if (connection.enabled) {
|
||||
container.addEventListener("click", async () => {
|
||||
const connectionRes=await fetch(this.info.api+"/v9/connections/" + key + "/authorize", {
|
||||
const connectionRes=await fetch(this.info.api+"/connections/" + key + "/authorize", {
|
||||
headers: this.headers
|
||||
});
|
||||
const connectionJSON=await connectionRes.json();
|
||||
|
@ -876,7 +876,7 @@ class Localuser{
|
|||
async () => {
|
||||
if (appName.trim().length == 0) return alert("Please enter a name for the application.");
|
||||
|
||||
const res=await fetch(this.info.api+"/v9/applications", {
|
||||
const res=await fetch(this.info.api+"/applications", {
|
||||
method: "POST",
|
||||
headers: this.headers,
|
||||
body: JSON.stringify({
|
||||
|
@ -895,7 +895,7 @@ class Localuser{
|
|||
], () => {}, async () => {
|
||||
appListContainer.innerHTML="";
|
||||
|
||||
const res=await fetch(this.info.api+"/v9/applications", {
|
||||
const res=await fetch(this.info.api+"/applications", {
|
||||
headers: this.headers
|
||||
});
|
||||
const json=await res.json();
|
||||
|
@ -926,7 +926,7 @@ class Localuser{
|
|||
)
|
||||
}
|
||||
async manageApplication(appId="") {
|
||||
const res=await fetch(this.info.api+"/v9/applications/" + appId, {
|
||||
const res=await fetch(this.info.api+"/applications/" + appId, {
|
||||
headers: this.headers
|
||||
});
|
||||
const json=await res.json();
|
||||
|
@ -976,7 +976,7 @@ class Localuser{
|
|||
"",
|
||||
"Save changes",
|
||||
async () => {
|
||||
const updateRes=await fetch(this.info.api+"/v9/applications/" + appId, {
|
||||
const updateRes=await fetch(this.info.api+"/applications/" + appId, {
|
||||
method: "PATCH",
|
||||
headers: this.headers,
|
||||
body: JSON.stringify(fields)
|
||||
|
@ -995,7 +995,7 @@ class Localuser{
|
|||
if (!json.bot) {
|
||||
if (!confirm("Are you sure you want to add a bot to this application? There's no going back.")) return;
|
||||
|
||||
const updateRes=await fetch(this.info.api+"/v9/applications/" + appId + "/bot", {
|
||||
const updateRes=await fetch(this.info.api+"/applications/" + appId + "/bot", {
|
||||
method: "POST",
|
||||
headers: this.headers
|
||||
});
|
||||
|
@ -1013,7 +1013,7 @@ class Localuser{
|
|||
appDialog.show();
|
||||
}
|
||||
async manageBot(appId="") {
|
||||
const res=await fetch(this.info.api+"/v9/applications/" + appId, {
|
||||
const res=await fetch(this.info.api+"/applications/" + appId, {
|
||||
headers: this.headers
|
||||
});
|
||||
const json=await res.json();
|
||||
|
@ -1048,7 +1048,7 @@ class Localuser{
|
|||
"",
|
||||
"Save changes",
|
||||
async () => {
|
||||
const updateRes=await fetch(this.info.api+"/v9/applications/" + appId + "/bot", {
|
||||
const updateRes=await fetch(this.info.api+"/applications/" + appId + "/bot", {
|
||||
method: "PATCH",
|
||||
headers: this.headers,
|
||||
body: JSON.stringify(fields)
|
||||
|
@ -1066,7 +1066,7 @@ class Localuser{
|
|||
async () => {
|
||||
if (!confirm("Are you sure you want to reset the bot token? Your bot will stop working until you update it.")) return;
|
||||
|
||||
const updateRes=await fetch(this.info.api+"/v9/applications/" + appId + "/bot/reset", {
|
||||
const updateRes=await fetch(this.info.api+"/applications/" + appId + "/bot/reset", {
|
||||
method: "POST",
|
||||
headers: this.headers
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue