allow changing api version on the fly

This commit is contained in:
Skillz
2020-07-14 18:27:09 -04:00
parent cfac630734
commit 99494d27d1
+7 -1
View File
@@ -1,9 +1,15 @@
let VERSION = 'v7'
export const baseEndpoints = {
/** Although, the version can be defaulted, keep the v6 as it can be changed to test newer versions when necessary. */
BASE_URL: "https://discord.com/api/v7",
BASE_URL: `https://discord.com/api/${VERSION}`,
CDN_URL: "https://cdn.discordapp.com",
};
export function changeAPIVersion(number = 7) {
VERSION = `v${number}`
}
const GUILDS_BASE = (id: string) => `${baseEndpoints.BASE_URL}/guilds/${id}`;
export const endpoints = {