Add a colour override for embed colours
All checks were successful
Test / build (push) Successful in 9s

- Using a new optional  value in the JSON, if set overrides the default one set by the rarity
- Added a failsafe if the override colour is invalid to default and log a warning

#349
This commit is contained in:
Ethan Lane 2024-08-29 19:21:53 +01:00
parent a10eaf7d75
commit 5deb6fcc14
3 changed files with 30 additions and 1 deletions

View file

@ -39,4 +39,18 @@ export default class StringTools {
public static ReplaceAll(str: string, find: string, replace: string) {
return str.replace(new RegExp(find, "g"), replace);
}
public static IsHexCode(str: string): boolean {
if (str.length != 6) return false;
const characters = "0123456789abcdefABCDEF";
for (let i = 0; i < 6; i++) {
const char = str[i];
if (!characters.includes(char)) return false;
}
return true;
}
}