mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 10:33:30 +01:00
Started rewrite
This commit is contained in:
35
src/Constants.js
Normal file
35
src/Constants.js
Normal file
@@ -0,0 +1,35 @@
|
||||
var API = "https://discordapp.com/api";
|
||||
var Endpoints = {
|
||||
|
||||
// general endpoints
|
||||
LOGIN: `${API}/auth/login`,
|
||||
LOGOUT: `${API}/auth/logout`,
|
||||
ME: `${API}/users/@me`,
|
||||
GATEWAY: `${API}/gateway`,
|
||||
USER_CHANNELS: (userID) => `${API}/users/${userID}/channels`,
|
||||
|
||||
// servers
|
||||
SERVERS: `${API}/guilds`,
|
||||
SERVER: (serverID) => `${Endpoints.SERVERS}/${serverID}`,
|
||||
SERVER_ICON: (serverID, hash) => `${Endpoints.SERVER(serverID) }/icons/${hash}.jpg`,
|
||||
SERVER_PRUNE: (serverID) => `${Endpoints.SERVER(serverID) }/prune`,
|
||||
SERVER_EMBED: (serverID) => `${Endpoints.SERVER(serverID) }/embed`,
|
||||
SERVER_INVITES: (serverID) => `${Endpoints.SERVER(serverID) }/invites`,
|
||||
SERVER_ROLES: (serverID) => `${Endpoints.SERVER(serverID) }/roles`,
|
||||
SERVER_BANS: (serverID) => `${Endpoints.SERVER(serverID) }/bans`,
|
||||
SERVER_INTEGRATIONS: (serverID) => `${Endpoints.SERVER(serverID) }/integrations`,
|
||||
SERVER_MEMBERS: (serverID) => `${Endpoints.SERVER(serverID) }/members`,
|
||||
SERVER_CHANNELS: (serverID) => `${Endpoints.SERVER(serverID) }/channels`,
|
||||
|
||||
// channels
|
||||
CHANNELS: `${API}/channels`,
|
||||
CHANNEL: (channelID) => `${Endpoints.CHANNELS}/${channelID}`,
|
||||
CHANNEL_MESSAGES: (channelID) => `${Endpoints.CHANNEL(channelID) }/messages`,
|
||||
CHANNEL_INVITES: (channelID) => `${Endpoints.CHANNEL(channelID) }/invites`,
|
||||
CHANNEL_TYPING: (channelID) => `${Endpoints.CHANNEL(channelID) }/typing`,
|
||||
CHANNEL_PERMISSIONS: (channelID) => `${Endpoints.CHANNEL(channelID) }/permissions`,
|
||||
|
||||
}
|
||||
|
||||
exports.API_ENDPOINT = API;
|
||||
exports.Endpoints = Endpoints;
|
||||
Reference in New Issue
Block a user