mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
refactor(rest): move user agent to constants
This commit is contained in:
+13
-7
@@ -1,13 +1,19 @@
|
||||
// These will never be modified and remain constants
|
||||
export const discordAPIURLS = {
|
||||
BASE_URL: `https://discord.com/api/v8`,
|
||||
CDN_URL: "https://cdn.discordapp.com",
|
||||
};
|
||||
/** https://discord.com/developers/docs/reference#api-reference-base-url */
|
||||
export const BASE_URL = "https://discord.com/api";
|
||||
|
||||
/** https://discord.com/developers/docs/reference#api-versioning-api-versions */
|
||||
export const API_VERSION = 8;
|
||||
|
||||
/** https://discord.com/developers/docs/reference#user-agent */
|
||||
export const USER_AGENT = "DiscordBot (https://github.com/discordeno/discordeno, v10)";
|
||||
|
||||
/** https://discord.com/developers/docs/reference#image-formatting-image-base-url */
|
||||
export const IMAGE_BASE_URL = "https://cdn.discordapp.com/";
|
||||
|
||||
// This can be modified by big brain bots and use a proxy
|
||||
export const baseEndpoints = {
|
||||
BASE_URL: discordAPIURLS.BASE_URL,
|
||||
CDN_URL: discordAPIURLS.CDN_URL,
|
||||
BASE_URL: `${BASE_URL}/v${API_VERSION}`,
|
||||
CDN_URL: IMAGE_BASE_URL,
|
||||
};
|
||||
|
||||
const GUILDS_BASE = (id: string) => `${baseEndpoints.BASE_URL}/guilds/${id}`;
|
||||
|
||||
Reference in New Issue
Block a user