mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
Added Colors file
removed colours for consistency
This commit is contained in:
7
lib/Color.js
Normal file
7
lib/Color.js
Normal 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);
|
||||||
|
};
|
||||||
@@ -68,12 +68,6 @@ var ServerPermissions = (function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_createClass(ServerPermissions, [{
|
_createClass(ServerPermissions, [{
|
||||||
key: "colour",
|
|
||||||
get: function get() {
|
|
||||||
// screw the american spelling
|
|
||||||
return this.color;
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: "createInstantInvite",
|
key: "createInstantInvite",
|
||||||
get: function get() {
|
get: function get() {
|
||||||
return this.getBit(0);
|
return this.getBit(0);
|
||||||
|
|||||||
@@ -3,10 +3,12 @@
|
|||||||
var request = require("superagent");
|
var request = require("superagent");
|
||||||
var Endpoints = require("./Endpoints.js");
|
var Endpoints = require("./Endpoints.js");
|
||||||
var Client = require("./Client.js");
|
var Client = require("./Client.js");
|
||||||
|
var Colors = require("../ref/colours.js");
|
||||||
|
|
||||||
var Discord = {
|
var Discord = {
|
||||||
Endpoints: Endpoints,
|
Endpoints: Endpoints,
|
||||||
Client: Client
|
Client: Client,
|
||||||
|
Colors: Colors
|
||||||
};
|
};
|
||||||
|
|
||||||
Discord.patchStrings = function () {
|
Discord.patchStrings = function () {
|
||||||
|
|||||||
27
ref/colours.js
Normal file
27
ref/colours.js
Normal 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
|
||||||
|
}
|
||||||
@@ -17,12 +17,7 @@ class ServerPermissions {
|
|||||||
this.id = data.id;
|
this.id = data.id;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get colour(){
|
|
||||||
// screw the american spelling
|
|
||||||
return this.color;
|
|
||||||
}
|
|
||||||
|
|
||||||
serialise() {
|
serialise() {
|
||||||
return {
|
return {
|
||||||
createInstantInvite : this.createInstantInvite,
|
createInstantInvite : this.createInstantInvite,
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
var request = require("superagent");
|
var request = require("superagent");
|
||||||
var Endpoints = require("./Endpoints.js");
|
var Endpoints = require("./Endpoints.js");
|
||||||
var Client = require("./Client.js");
|
var Client = require("./Client.js");
|
||||||
|
var Colors = require("../ref/colours.js");
|
||||||
|
|
||||||
var Discord = {
|
var Discord = {
|
||||||
Endpoints : Endpoints,
|
Endpoints : Endpoints,
|
||||||
Client : Client
|
Client : Client,
|
||||||
|
Colors : Colors
|
||||||
}
|
}
|
||||||
|
|
||||||
Discord.patchStrings = function () {
|
Discord.patchStrings = function () {
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ mybot.on("message", function (message) {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
permission.manageRoles = true;
|
permission.manageRoles = true;
|
||||||
permission.name="asdfasdf";
|
permission.name="asdfasdf";
|
||||||
|
permission.color = Discord.Colors.GREEN;
|
||||||
|
|
||||||
mybot.updateRole(message.channel.server, permission).then((perm) => {
|
mybot.updateRole(message.channel.server, permission).then((perm) => {
|
||||||
mybot.reply(message, JSON.stringify(perm.serialise(), null, 4));
|
mybot.reply(message, JSON.stringify(perm.serialise(), null, 4));
|
||||||
|
|||||||
Reference in New Issue
Block a user