Added message reply, embeds, and bot login capabilities

This commit is contained in:
ION606
2023-03-19 18:02:21 -04:00
parent 35b993b3fe
commit 9faf4a315e
9 changed files with 422 additions and 55 deletions
+24
View File
@@ -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;
+32
View File
@@ -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,
};