Added Colors file

removed colours for consistency
This commit is contained in:
hydrabolt
2015-10-26 13:36:13 +00:00
parent 08ffd473e4
commit 1de2c5e5be
7 changed files with 42 additions and 14 deletions

7
lib/Color.js Normal file
View File

@@ -0,0 +1,7 @@
"use strict";
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Color = function Color() {
_classCallCheck(this, Color);
};

View File

@@ -68,12 +68,6 @@ var ServerPermissions = (function () {
};
_createClass(ServerPermissions, [{
key: "colour",
get: function get() {
// screw the american spelling
return this.color;
}
}, {
key: "createInstantInvite",
get: function get() {
return this.getBit(0);

View File

@@ -3,10 +3,12 @@
var request = require("superagent");
var Endpoints = require("./Endpoints.js");
var Client = require("./Client.js");
var Colors = require("../ref/colours.js");
var Discord = {
Endpoints: Endpoints,
Client: Client
Client: Client,
Colors: Colors
};
Discord.patchStrings = function () {

27
ref/colours.js Normal file
View File

@@ -0,0 +1,27 @@
/*
credits to izy521 for the colour list]
https://github.com/izy521/discord.io/blob/master/docs/colors.md
*/
module.exports = {
DEFAULT: 0,
AQUA: 1752220,
GREEN: 3066993,
BLUE: 3447003,
PURPLE: 10181046,
GOLD: 15844367,
ORANGE: 15105570,
RED: 15158332,
GREY: 9807270,
DARKER_GREY: 8359053,
NAVY: 3426654,
DARK_AQUA: 1146986,
DARK_GREEN: 2067276,
DARK_BLUE: 2123412,
DARK_PURPLE: 7419530,
DARK_GOLD: 12745742,
DARK_ORANGE: 11027200,
DARK_RED: 10038562,
DARK_GREY: 9936031,
LIGHT_GREY: 12370112,
DARK_NAVY: 2899536
}

View File

@@ -17,12 +17,7 @@ class ServerPermissions {
this.id = data.id;
}
get colour(){
// screw the american spelling
return this.color;
}
serialise() {
return {
createInstantInvite : this.createInstantInvite,

View File

@@ -1,10 +1,12 @@
var request = require("superagent");
var Endpoints = require("./Endpoints.js");
var Client = require("./Client.js");
var Colors = require("../ref/colours.js");
var Discord = {
Endpoints : Endpoints,
Client : Client
Client : Client,
Colors : Colors
}
Discord.patchStrings = function () {

View File

@@ -36,6 +36,7 @@ mybot.on("message", function (message) {
setTimeout(() => {
permission.manageRoles = true;
permission.name="asdfasdf";
permission.color = Discord.Colors.GREEN;
mybot.updateRole(message.channel.server, permission).then((perm) => {
mybot.reply(message, JSON.stringify(perm.serialise(), null, 4));