diff --git a/src/client/rest/APIRequest.js b/src/client/rest/APIRequest.js index a96249a7a..9382c9ae2 100644 --- a/src/client/rest/APIRequest.js +++ b/src/client/rest/APIRequest.js @@ -32,7 +32,7 @@ class APIRequest { } 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) { const queryString = (querystring.stringify(this.options.query).match(/[^=&?]+=[^=&?]+/g) || []).join('&'); diff --git a/src/structures/Invite.js b/src/structures/Invite.js index ac883761d..53a94f081 100644 --- a/src/structures/Invite.js +++ b/src/structures/Invite.js @@ -136,7 +136,7 @@ class Invite { * @readonly */ get url() { - return Constants.Endpoints.invite(this.code); + return Constants.Endpoints.invite(this.client.options.http.invite, this.code); } /** diff --git a/src/util/Constants.js b/src/util/Constants.js index 3370b02af..7af384ba9 100644 --- a/src/util/Constants.js +++ b/src/util/Constants.js @@ -67,8 +67,9 @@ exports.DefaultOptions = { }, http: { version: 7, - host: 'https://discordapp.com', + api: 'https://discordapp.com/api', 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', };