mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
update http options to fit discord spec (#1656)
* Update Constants.js * Update APIRequest.js * Update Invite.js * Update Constants.js
This commit is contained in:
@@ -32,7 +32,7 @@ class APIRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gen() {
|
gen() {
|
||||||
const API = `${this.client.options.http.host}/api/v${this.client.options.http.version}`;
|
const API = `${this.client.options.http.api}/v${this.client.options.http.version}`;
|
||||||
|
|
||||||
if (this.options.query) {
|
if (this.options.query) {
|
||||||
const queryString = (querystring.stringify(this.options.query).match(/[^=&?]+=[^=&?]+/g) || []).join('&');
|
const queryString = (querystring.stringify(this.options.query).match(/[^=&?]+=[^=&?]+/g) || []).join('&');
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ class Invite {
|
|||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get url() {
|
get url() {
|
||||||
return Constants.Endpoints.invite(this.code);
|
return Constants.Endpoints.invite(this.client.options.http.invite, this.code);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -67,8 +67,9 @@ exports.DefaultOptions = {
|
|||||||
},
|
},
|
||||||
http: {
|
http: {
|
||||||
version: 7,
|
version: 7,
|
||||||
host: 'https://discordapp.com',
|
api: 'https://discordapp.com/api',
|
||||||
cdn: 'https://cdn.discordapp.com',
|
cdn: 'https://cdn.discordapp.com',
|
||||||
|
invite: 'https://discord.gg',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -124,7 +125,7 @@ exports.Endpoints = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
invite: code => `https://discord.gg/${code}`,
|
invite: (root, code) => `${root}/${code}`,
|
||||||
botGateway: '/gateway/bot',
|
botGateway: '/gateway/bot',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user