mirror of
https://github.com/ION606/custom_discordjs.git
synced 2026-06-06 00:07:01 +00:00
Added message reply, embeds, and bot login capabilities
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
const Colors = require('./colors.js');
|
||||
|
||||
/**
|
||||
* Resolves a ColorResolvable into a color number.
|
||||
* @param {String} color Color to resolve
|
||||
* @returns {Number} A color
|
||||
*/
|
||||
function resolveColor(color) {
|
||||
if (typeof color === 'string') {
|
||||
if (color === 'Random') return Math.floor(Math.random() * (0xffffff + 1));
|
||||
if (color === 'Default') return 0;
|
||||
color = Colors[color] ?? parseInt(color.replace('#', ''), 16);
|
||||
} else if (Array.isArray(color)) {
|
||||
color = (color[0] << 16) + (color[1] << 8) + color[2];
|
||||
}
|
||||
|
||||
if (color < 0 || color > 0xffffff) throw new RangeError('COLOR_RANGE');
|
||||
else if (Number.isNaN(color)) throw new TypeError('COLOR_CONVERT');
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
|
||||
module.exports = resolveColor;
|
||||
@@ -0,0 +1,32 @@
|
||||
module.exports = {
|
||||
Default: 0x000000,
|
||||
White: 0xffffff,
|
||||
Aqua: 0x1abc9c,
|
||||
Green: 0x57f287,
|
||||
Blue: 0x3498db,
|
||||
Yellow: 0xfee75c,
|
||||
Purple: 0x9b59b6,
|
||||
LuminousVividPink: 0xe91e63,
|
||||
Fuchsia: 0xeb459e,
|
||||
Gold: 0xf1c40f,
|
||||
Orange: 0xe67e22,
|
||||
Red: 0xed4245,
|
||||
Grey: 0x95a5a6,
|
||||
Navy: 0x34495e,
|
||||
DarkAqua: 0x11806a,
|
||||
DarkGreen: 0x1f8b4c,
|
||||
DarkBlue: 0x206694,
|
||||
DarkPurple: 0x71368a,
|
||||
DarkVividPink: 0xad1457,
|
||||
DarkGold: 0xc27c0e,
|
||||
DarkOrange: 0xa84300,
|
||||
DarkRed: 0x992d22,
|
||||
DarkGrey: 0x979c9f,
|
||||
DarkerGrey: 0x7f8c8d,
|
||||
LightGrey: 0xbcc0c0,
|
||||
DarkNavy: 0x2c3e50,
|
||||
Blurple: 0x5865f2,
|
||||
Greyple: 0x99aab5,
|
||||
DarkButNotBlack: 0x2c2f33,
|
||||
NotQuiteBlack: 0x23272a,
|
||||
};
|
||||
Reference in New Issue
Block a user