mirror of
https://github.com/danbulant/discord.js
synced 2026-05-26 05:22:15 +00:00
Change the way constants are exported (#431)
This commit is contained in:
parent
0e4612d7ab
commit
fe3f6c7d20
2 changed files with 19 additions and 12 deletions
|
|
@ -1,9 +1,11 @@
|
|||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
var API = "https://discordapp.com/api";
|
||||
exports.API = API;
|
||||
var Endpoints = {
|
||||
var Constants = {};
|
||||
|
||||
var API = Constants.API = "https://discordapp.com/api";
|
||||
|
||||
Constants.Endpoints = {
|
||||
// general endpoints
|
||||
LOGIN: API + "/auth/login",
|
||||
LOGOUT: API + "/auth/logout",
|
||||
|
|
@ -79,8 +81,7 @@ var Endpoints = {
|
|||
FRIENDS: API + "/users/@me/relationships"
|
||||
};
|
||||
|
||||
exports.Endpoints = Endpoints;
|
||||
var Permissions = {
|
||||
Constants.Permissions = {
|
||||
// general
|
||||
createInstantInvite: 1 << 0,
|
||||
kickMembers: 1 << 1,
|
||||
|
|
@ -112,8 +113,7 @@ var Permissions = {
|
|||
|
||||
};
|
||||
|
||||
exports.Permissions = Permissions;
|
||||
var PacketType = {
|
||||
Constants.PacketType = {
|
||||
CHANNEL_CREATE: "CHANNEL_CREATE",
|
||||
CHANNEL_DELETE: "CHANNEL_DELETE",
|
||||
CHANNEL_UPDATE: "CHANNEL_UPDATE",
|
||||
|
|
@ -141,4 +141,6 @@ var PacketType = {
|
|||
FRIEND_ADD: "RELATIONSHIP_ADD",
|
||||
FRIEND_REMOVE: "RELATIONSHIP_REMOVE"
|
||||
};
|
||||
exports.PacketType = PacketType;
|
||||
|
||||
exports["default"] = Constants;
|
||||
module.exports = exports["default"];
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
export const API = "https://discordapp.com/api";
|
||||
export const Endpoints = {
|
||||
const Constants = {};
|
||||
|
||||
const API = Constants.API = "https://discordapp.com/api";
|
||||
|
||||
Constants.Endpoints = {
|
||||
// general endpoints
|
||||
LOGIN: `${API}/auth/login`,
|
||||
LOGOUT: `${API}/auth/logout`,
|
||||
|
|
@ -39,7 +42,7 @@ export const Endpoints = {
|
|||
FRIENDS: `${API}/users/@me/relationships`
|
||||
};
|
||||
|
||||
export const Permissions = {
|
||||
Constants.Permissions = {
|
||||
// general
|
||||
createInstantInvite: 1 << 0,
|
||||
kickMembers: 1 << 1,
|
||||
|
|
@ -71,7 +74,7 @@ export const Permissions = {
|
|||
|
||||
};
|
||||
|
||||
export const PacketType = {
|
||||
Constants.PacketType = {
|
||||
CHANNEL_CREATE : "CHANNEL_CREATE",
|
||||
CHANNEL_DELETE : "CHANNEL_DELETE",
|
||||
CHANNEL_UPDATE : "CHANNEL_UPDATE",
|
||||
|
|
@ -99,3 +102,5 @@ export const PacketType = {
|
|||
FRIEND_ADD : "RELATIONSHIP_ADD",
|
||||
FRIEND_REMOVE : "RELATIONSHIP_REMOVE"
|
||||
};
|
||||
|
||||
export default Constants;
|
||||
|
|
|
|||
Loading…
Reference in a new issue