diff --git a/.env.template b/.env.template index 8635041e..3003a69a 100644 --- a/.env.template +++ b/.env.template @@ -23,7 +23,6 @@ REMINDER_FREQUENCY=60 DISCORD_TOKEN=xxxxxxxxxxxxxxxxx DISCORD_PREFIX=) DISCORD_INVITE_LINK=discord.gg/ -USE_RANK_EMOJIS=false MEMBER_CHANNEL_ID=xxxxxxxxxxxxxxxxx OFFICER_CHANNEL_ID=xxxxxxxxxxxxxxxxx diff --git a/.gitignore b/.gitignore index 9e94d2b8..fdefa8bf 100644 --- a/.gitignore +++ b/.gitignore @@ -75,9 +75,8 @@ history/ .env .env.test -# Blacklist and emojis file -src/util/_blacklist.json -src/util/emojis/_emojiIds.json +# Blacklist file +src/util/blacklist/_blacklist.json # parcel-bundler cache (https://parceljs.org/) .cache @@ -122,6 +121,5 @@ dist .yarn/install-state.gz .pnp.* - #MacOSX SHIT .DS_Store \ No newline at end of file diff --git a/README.md b/README.md index ed1637a1..4da7d6c1 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,6 @@ - [Installation](#installation) - [Prerequisites](#prerequisites) - [Setup](#setup) - - [Rank Emojis](#rank-emojis) - [Process Management](#process-management) - [Contributing](#contributing) - [Issues and Bug Reports](#issues-and-bug-reports) @@ -38,7 +37,6 @@ - Bridges between Discord and Hypixel guild chats. - Sends all guild related messages, including chat, guild announcements and more to Discord. - Automatic restarts and reconnections. -- Toggleable use of Discord emojis for Hypixel ranks in chat messages. - Privileged slash commands to control bot behaviour in-game. - Toggleable slowmode to control member usage. - Basic filtering of extreme profanity to protect bot accounts from abuse. @@ -97,19 +95,6 @@ $ pnpm run build $ pnpm start ``` -### Rank Emojis - -Optionally, you may activate the use of rank emojis in discord messages by following these steps: - -1. Run the `/emojis upload` command in a discord server of your choice. - - > **Note** - > It is recommended to run this command in an alternate server, as it uses a significant number of emoji slots. In this case, the user of id `BOT_OWNER_ID` is the only person with permission to run this command. - -2. Set the value of `USE_RANK_EMOJIS` in the `.env` file to `true`, or `false` to disable this feature. - -If at any time you wish to delete the emojis created by the bot, run the `/emojis remove` command. - ### Process Management If you are self-hosting or your process manager does not automatically restart the bot in the event of a crash, you may use [PM2](https://pm2.keymetrics.io/), a process manager for Node.js applications. diff --git a/package.json b/package.json index dc25276a..a19393d1 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,8 @@ "license": "MIT", "private": false, "scripts": { - "build": "tsc && pnpm copy-files", + "build": "tsc", "clean": "rm -r dist/", - "copy-files": "copyfiles -u 1 src/**/*.png dist/", "dev": "ts-node-dev --respawn --transpile-only --poll src/index.ts", "lint:fix": "pnpm lint --fix", "lint": "eslint . --ext .ts,.tsx", @@ -22,7 +21,6 @@ }, "dependencies": { "consola": "^2.15.3", - "copyfiles": "^2.4.1", "discord.js": "14.10.2", "dotenv": "^16.0.3", "mineflayer": "^4.4.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dd12cd3d..063db655 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,9 +8,6 @@ dependencies: consola: specifier: ^2.15.3 version: 2.15.3 - copyfiles: - specifier: ^2.4.1 - version: 2.4.1 discord.js: specifier: 14.10.2 version: 14.10.2 @@ -519,12 +516,14 @@ packages: /ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} + dev: true /ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} dependencies: color-convert: 2.0.1 + dev: true /anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} @@ -565,6 +564,7 @@ packages: /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: true /base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} @@ -580,6 +580,7 @@ packages: dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 + dev: true /braces@3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} @@ -636,22 +637,16 @@ packages: fsevents: 2.3.3 dev: true - /cliui@7.0.4: - resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - dev: false - /color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} dependencies: color-name: 1.1.4 + dev: true /color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true /combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} @@ -666,28 +661,12 @@ packages: /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: true /consola@2.15.3: resolution: {integrity: sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==} dev: false - /copyfiles@2.4.1: - resolution: {integrity: sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==} - hasBin: true - dependencies: - glob: 7.2.3 - minimatch: 3.1.2 - mkdirp: 1.0.4 - noms: 0.0.0 - through2: 2.0.5 - untildify: 4.0.0 - yargs: 16.2.0 - dev: false - - /core-util-is@1.0.3: - resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} - dev: false - /create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} dev: true @@ -788,19 +767,10 @@ packages: safe-buffer: 5.2.1 dev: false - /emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - dev: false - /endian-toggle@0.0.0: resolution: {integrity: sha512-ShfqhXeHRE4TmggSlHXG8CMGIcsOsqDw/GcoPcosToE59Rm9e4aXaMhEQf2kPBsBRrKem1bbOAv5gOKnkliMFQ==} dev: false - /escalade@3.1.1: - resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} - engines: {node: '>=6'} - dev: false - /escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} @@ -1025,6 +995,7 @@ packages: /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: true /fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} @@ -1038,11 +1009,6 @@ packages: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} dev: true - /get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - dev: false - /glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -1066,6 +1032,7 @@ packages: minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 + dev: true /globals@13.23.0: resolution: {integrity: sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==} @@ -1129,6 +1096,7 @@ packages: dependencies: once: 1.4.0 wrappy: 1.0.2 + dev: true /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} @@ -1151,11 +1119,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - dev: false - /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -1173,14 +1136,6 @@ packages: engines: {node: '>=8'} dev: true - /isarray@0.0.1: - resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==} - dev: false - - /isarray@1.0.0: - resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} - dev: false - /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true @@ -1410,6 +1365,7 @@ packages: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: brace-expansion: 1.1.11 + dev: true /minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} @@ -1419,6 +1375,7 @@ packages: resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} engines: {node: '>=10'} hasBin: true + dev: true /mojangson@2.0.4: resolution: {integrity: sha512-HYmhgDjr1gzF7trGgvcC/huIg2L8FsVbi/KacRe6r1AswbboGVZDS47SOZlomPuMWvZLas8m9vuHHucdZMwTmQ==} @@ -1473,13 +1430,6 @@ packages: asn1: 0.2.3 dev: false - /noms@0.0.0: - resolution: {integrity: sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==} - dependencies: - inherits: 2.0.4 - readable-stream: 1.0.34 - dev: false - /normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} @@ -1494,6 +1444,7 @@ packages: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: wrappy: 1.0.2 + dev: true /optionator@0.9.3: resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} @@ -1536,6 +1487,7 @@ packages: /path-is-absolute@1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} + dev: true /path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} @@ -1703,10 +1655,6 @@ packages: vec3: 0.1.8 dev: false - /process-nextick-args@2.0.1: - resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} - dev: false - /process@0.11.10: resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} engines: {node: '>= 0.6.0'} @@ -1749,27 +1697,6 @@ packages: ret: 0.1.15 dev: false - /readable-stream@1.0.34: - resolution: {integrity: sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==} - dependencies: - core-util-is: 1.0.3 - inherits: 2.0.4 - isarray: 0.0.1 - string_decoder: 0.10.31 - dev: false - - /readable-stream@2.3.8: - resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} - dependencies: - core-util-is: 1.0.3 - inherits: 2.0.4 - isarray: 1.0.0 - process-nextick-args: 2.0.1 - safe-buffer: 5.1.2 - string_decoder: 1.1.1 - util-deprecate: 1.0.2 - dev: false - /readable-stream@3.6.2: resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} engines: {node: '>= 6'} @@ -1804,11 +1731,6 @@ packages: picomatch: 2.3.1 dev: true - /require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - dev: false - /resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -1910,25 +1832,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - dev: false - - /string_decoder@0.10.31: - resolution: {integrity: sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==} - dev: false - - /string_decoder@1.1.1: - resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} - dependencies: - safe-buffer: 5.1.2 - dev: false - /string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} dependencies: @@ -1940,6 +1843,7 @@ packages: engines: {node: '>=8'} dependencies: ansi-regex: 5.0.1 + dev: true /strip-bom@3.0.0: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} @@ -1980,13 +1884,6 @@ packages: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true - /through2@2.0.5: - resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==} - dependencies: - readable-stream: 2.3.8 - xtend: 4.0.2 - dev: false - /to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -2143,11 +2040,6 @@ packages: '@fastify/busboy': 2.1.0 dev: false - /untildify@4.0.0: - resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} - engines: {node: '>=8'} - dev: false - /uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: @@ -2195,17 +2087,9 @@ packages: isexe: 2.0.0 dev: true - /wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - dev: false - /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + dev: true /ws@8.14.2: resolution: {integrity: sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==} @@ -2223,37 +2107,15 @@ packages: /xtend@4.0.2: resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} engines: {node: '>=0.4'} + dev: true /xxhash-wasm@0.4.2: resolution: {integrity: sha512-/eyHVRJQCirEkSZ1agRSCwriMhwlyUcFkXD5TPVSLP+IPzjsqMVzZwdoczLp1SoQU0R3dxz1RpIK+4YNQbCVOA==} dev: false - /y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - dev: false - /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - /yargs-parser@20.2.9: - resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} - engines: {node: '>=10'} - dev: false - - /yargs@16.2.0: - resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} - engines: {node: '>=10'} - dependencies: - cliui: 7.0.4 - escalade: 3.1.1 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 20.2.9 - dev: false - /yggdrasil@1.7.0: resolution: {integrity: sha512-QBIo5fiNd7688G3FqXXYGr36uyrYzczlNuzpWFy2zL3+R+3KT2lF+wFxm51synfA3l3z6IBiGOc1/EVXWCYY1Q==} dependencies: diff --git a/setupFiles.js b/setupFiles.js index baed9d85..00c21bf8 100644 --- a/setupFiles.js +++ b/setupFiles.js @@ -1,7 +1,7 @@ // eslint-disable-next-line @typescript-eslint/no-var-requires const fs = require("fs"); -const files = [".env", "src/util/_blacklist.json", "src/util/emojis/_emojiIds.json"]; +const files = [".env", "src/util/blacklist/_blacklist.json"]; for (const newPath of files) { const oldPath = `${newPath}.template`; diff --git a/src/commands/blacklist.ts b/src/commands/blacklist.ts index 1a160676..102ef80e 100644 --- a/src/commands/blacklist.ts +++ b/src/commands/blacklist.ts @@ -1,7 +1,7 @@ import { ApplicationCommandOptionType, EmbedBuilder, TextChannel } from "discord.js"; import { BlacklistEntry } from "../interfaces/BlacklistEntry"; import { Command } from "../interfaces/Command"; -import _blacklist from "../util/_blacklist.json"; +import _blacklist from "../util/blacklist/_blacklist.json"; import fetchErrorEmbed from "../util/requests/fetchErrorEmbed"; import fetchMojangProfile from "../util/requests/fetchMojangProfile"; import isFetchError from "../util/requests/isFetchError"; diff --git a/src/commands/emojis.ts b/src/commands/emojis.ts deleted file mode 100644 index 4308206a..00000000 --- a/src/commands/emojis.ts +++ /dev/null @@ -1,118 +0,0 @@ -import { ApplicationCommandOptionType, EmbedBuilder, GuildPremiumTier } from "discord.js"; -import { Emoji, EmojiIds } from "../interfaces/EmojiIds"; -import { VerboseHypixelRank, VerboseHypixelRanks } from "../interfaces/Ranks"; -import { Command } from "../interfaces/Command"; -import _emojiIds from "../util/emojis/_emojiIds.json"; -import getEmojiBuffers from "../util/emojis/getEmojiBuffers"; -import writeToJsonFile from "../util/writeToJsonFile"; - -export default { - data: { - name: "emojis", - description: "Upload or remove Hypixel rank emojis", - options: [ - { - name: "upload", - description: "Upload all Hypixel rank emojis to the server!", - type: ApplicationCommandOptionType.Subcommand, - }, - { - name: "remove", - description: "Remove all Hypixel rank emojis from the server!", - type: ApplicationCommandOptionType.Subcommand, - }, - ], - }, - run: async (bot, interaction) => { - const type = interaction.options.getSubcommand() as "upload" | "remove"; - const emojiIds = _emojiIds as EmojiIds; - - await interaction.deferReply(); - - if (type === "upload") { - let maxEmojis: GuildPremiumTier; - switch (interaction.guild?.premiumTier) { - case GuildPremiumTier.Tier1: - maxEmojis = 100; - break; - case GuildPremiumTier.Tier2: - maxEmojis = 150; - break; - case GuildPremiumTier.Tier3: - maxEmojis = 250; - break; - default: - maxEmojis = 50; - break; - } - - const emojiBuffers = await getEmojiBuffers(); - - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - if (interaction.guild!.emojis.cache.size + Object.keys(emojiBuffers).length > maxEmojis) { - const embed = new EmbedBuilder() - .setColor("Red") - .setTitle("Error") - .setDescription( - `Not enough emoji slots! This command requires ${Object.keys(emojiBuffers).length} open slots.`, - ); - interaction.editReply({ embeds: [embed] }); - return; - } - - for (const [name, buffer] of Object.entries(emojiBuffers)) { - const rankName = Object.keys(VerboseHypixelRanks).find( - (rank) => name.toString().replace(/[0-9]/g, "") === rank, - ) as VerboseHypixelRank | undefined; - - if (!rankName) { - const embed = new EmbedBuilder() - .setColor("Red") - .setTitle("Error") - .setDescription(`An unexpected error occured: Unkown emoji ${name}`); - - await interaction.editReply({ embeds: [embed] }); - return; - } - - // Check if the rank has no value - if (!emojiIds[rankName]) { - emojiIds[rankName] = []; - } - - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const emoji = await interaction.guild!.emojis.create({ attachment: buffer, name: name }); - (emojiIds[rankName] as Emoji[]).push({ name: emoji.name as string, id: emoji.id }); - } - } else if (type === "remove") { - for (const emojis of Object.values(emojiIds)) { - for (const emoji of emojis) { - try { - bot.discord.emojis.cache.get(emoji.id)?.delete(); - } catch (e) { - // Delete emoji anyhow, as to avoid causing errors in the future - emojis.splice(emojis.indexOf(emoji)); - - const embed = new EmbedBuilder() - .setColor("Red") - .setTitle("Error") - .setDescription(`Failed to delete emoji ${emoji.name}`); - - await interaction.editReply({ embeds: [embed] }); - return; - } - - emojis.splice(emojis.indexOf(emoji)); - } - } - } - - const successEmbed = new EmbedBuilder() - .setColor("Green") - .setTitle("✅ Done") - .setDescription(`All Hypixel rank emojis have been ${type === "upload" ? "uploaded" : "removed"}!`); - - writeToJsonFile("./src/util/emojis/_emojiIds.json", emojiIds, interaction, successEmbed); - }, - staffonly: true, -} as Command; diff --git a/src/events/discord/message.ts b/src/events/discord/message.ts index 76c3e1b7..062aebca 100644 --- a/src/events/discord/message.ts +++ b/src/events/discord/message.ts @@ -1,7 +1,7 @@ import { Message } from "discord.js"; import { DataSet, RegExpMatcher, englishDataset, englishRecommendedTransformers } from "obscenity"; import { Event } from "../../interfaces/Event"; -import emojis from "../../util/emojis/chatEmojis"; +import emojis from "../../util/emojis"; const whitelist = ["ass", "bitch", "cock", "dick", "fuck"]; const dataset = new DataSet<{ originalWord: string }>() diff --git a/src/events/mineflayer/chat/commentBlocked.ts b/src/events/mineflayer/chat/commentBlocked.ts index 380dd6d3..77d7e9e9 100644 --- a/src/events/mineflayer/chat/commentBlocked.ts +++ b/src/events/mineflayer/chat/commentBlocked.ts @@ -1,4 +1,4 @@ -import Emojis from "../../../util/emojis/chatEmojis"; +import Emojis from "../../../util/emojis"; import { Event } from "../../../interfaces/Event"; export default { diff --git a/src/events/mineflayer/chat/guildChat.ts b/src/events/mineflayer/chat/guildChat.ts index 2eb27693..9e28a68a 100644 --- a/src/events/mineflayer/chat/guildChat.ts +++ b/src/events/mineflayer/chat/guildChat.ts @@ -1,7 +1,6 @@ import { Event } from "../../../interfaces/Event"; -import { HypixelRank } from "../../../interfaces/Ranks"; import { escapeMarkdown } from "discord.js"; -import getRankData from "../../../util/emojis/getRankData"; +import getRankColor from "../../../util/getRankColor"; export default { name: "chat:guildChat", @@ -9,16 +8,15 @@ export default { run: async ( bot, channel: "Guild" | "Officer", - hypixelRank: HypixelRank | undefined, + rank: string | undefined, playerName: string, guildRank: string | undefined, message: string, ) => { - const [rank, color] = await getRankData(hypixelRank); const content = ` **${rank ? rank + " " : ""}${escapeMarkdown(playerName)}${ guildRank ? " " + guildRank : "" }:** ${escapeMarkdown(message)}`; - await bot.sendToDiscord(channel === "Guild" ? "gc" : "oc", content, color); + await bot.sendToDiscord(channel === "Guild" ? "gc" : "oc", content, getRankColor(rank)); }, } as Event; diff --git a/src/events/mineflayer/chat/guildMuteUnmute.ts b/src/events/mineflayer/chat/guildMuteUnmute.ts index f068f812..5b6351b3 100644 --- a/src/events/mineflayer/chat/guildMuteUnmute.ts +++ b/src/events/mineflayer/chat/guildMuteUnmute.ts @@ -1,28 +1,24 @@ -import Emojis from "../../../util/emojis/chatEmojis"; +import Emojis from "../../../util/emojis"; import { Event } from "../../../interfaces/Event"; -import { HypixelRank } from "../../../interfaces/Ranks"; import { escapeMarkdown } from "discord.js"; -import getRankData from "../../../util/emojis/getRankData"; export default { name: "chat:guildMuteUnmute", runOnce: false, run: async ( bot, - byHypixelRank: HypixelRank | undefined, - byPlayerName: string, + authorRank: string | undefined, + authorName: string, type: "muted" | "unmuted", - hypixelRank: HypixelRank | undefined, - playerName: string, + victimRank: string | undefined, + victimName: string, duration: string | undefined, ) => { - const [[byRank], [rank]] = await Promise.all([getRankData(byHypixelRank), getRankData(hypixelRank)]); - const content = `${type === "unmuted" ? Emojis.positiveGuildEvent : Emojis.negativeGuildEvent} **${ - byRank ? byRank + " " : "" - }${escapeMarkdown(byPlayerName)}** has ${type} **${rank ? rank + " " : ""}${escapeMarkdown(playerName)}**${ - duration ? ` for ${duration}` : "" - }`; + authorRank ? authorRank + " " : "" + }${escapeMarkdown(authorName)}** has ${type} **${victimRank ? victimRank + " " : ""}${escapeMarkdown( + victimName, + )}**${duration ? ` for ${duration}` : ""}`; await bot.sendToDiscord("gc", content, undefined, true); }, diff --git a/src/events/mineflayer/chat/joinLeave.ts b/src/events/mineflayer/chat/joinLeave.ts index ab981e14..8aa4fcf9 100644 --- a/src/events/mineflayer/chat/joinLeave.ts +++ b/src/events/mineflayer/chat/joinLeave.ts @@ -1,4 +1,4 @@ -import Emojis from "../../../util/emojis/chatEmojis"; +import Emojis from "../../../util/emojis"; import { Event } from "../../../interfaces/Event"; import { escapeMarkdown } from "discord.js"; diff --git a/src/events/mineflayer/chat/joinRequest.ts b/src/events/mineflayer/chat/joinRequest.ts index 8aae3e57..1552becf 100644 --- a/src/events/mineflayer/chat/joinRequest.ts +++ b/src/events/mineflayer/chat/joinRequest.ts @@ -2,7 +2,7 @@ import { Event } from "../../../interfaces/Event"; import fetchHypixelPlayerProfile from "../../../util/requests/fetchHypixelPlayerProfile"; import fetchMojangProfile from "../../../util/requests/fetchMojangProfile"; import isFetchError from "../../../util/requests/isFetchError"; -import isUserBlacklisted from "../../../util/isUserBlacklisted"; +import isUserBlacklisted from "../../../util/blacklist/isUserBlacklisted"; export default { name: "chat:joinRequest", diff --git a/src/events/mineflayer/chat/memberJoinLeave.ts b/src/events/mineflayer/chat/memberJoinLeave.ts index e3bafbbc..915876d1 100644 --- a/src/events/mineflayer/chat/memberJoinLeave.ts +++ b/src/events/mineflayer/chat/memberJoinLeave.ts @@ -1,18 +1,15 @@ -import Emojis from "../../../util/emojis/chatEmojis"; +import Emojis from "../../../util/emojis"; import { Event } from "../../../interfaces/Event"; -import { HypixelRank } from "../../../interfaces/Ranks"; import { escapeMarkdown } from "discord.js"; import fetchMojangProfile from "../../../util/requests/fetchMojangProfile"; -import getRankData from "../../../util/emojis/getRankData"; import isFetchError from "../../../util/requests/isFetchError"; -import isUserBlacklisted from "../../../util/isUserBlacklisted"; +import isUserBlacklisted from "../../../util/blacklist/isUserBlacklisted"; +import getRankColor from "../../../util/getRankColor"; export default { name: "chat:memberJoinLeave", runOnce: false, - run: async (bot, hypixelRank: HypixelRank | undefined, playerName: string, type: "joined" | "left") => { - const [rank, color] = await getRankData(hypixelRank); - + run: async (bot, rank: string | undefined, playerName: string, type: "joined" | "left") => { if (type === "joined") { const mojangProfile = await fetchMojangProfile(playerName); @@ -28,7 +25,7 @@ export default { `${type === "joined" ? Emojis.positiveGuildEvent : Emojis.negativeGuildEvent} **${ rank ? rank + " " : "" }${escapeMarkdown(playerName)}** ${type} the guild!`, - color, + getRankColor(rank), true, ); }, diff --git a/src/events/mineflayer/chat/memberKick.ts b/src/events/mineflayer/chat/memberKick.ts index 43fc6f7b..e7c08a23 100644 --- a/src/events/mineflayer/chat/memberKick.ts +++ b/src/events/mineflayer/chat/memberKick.ts @@ -1,24 +1,17 @@ -import Emojis from "../../../util/emojis/chatEmojis"; +import Emojis from "../../../util/emojis"; import { Event } from "../../../interfaces/Event"; -import { HypixelRank } from "../../../interfaces/Ranks"; import { escapeMarkdown } from "discord.js"; -import getRankData from "../../../util/emojis/getRankData"; export default { name: "chat:memberKick", runOnce: false, run: async ( bot, - hypixelRank: HypixelRank | undefined, + rank: string | undefined, playerName: string, - kickedByHypixelRank: HypixelRank | undefined, + kickedByRank: string | undefined, kickedByPlayerName: string, ) => { - const [[rank], [kickedByRank]] = await Promise.all([ - getRankData(hypixelRank), - getRankData(kickedByHypixelRank), - ]); - await bot.sendToDiscord( "gc", `${Emojis.negativeGuildEvent} **${rank ? rank + " " : ""}${escapeMarkdown(playerName)}** was kicked by **${ diff --git a/src/events/mineflayer/chat/promoteDemote.ts b/src/events/mineflayer/chat/promoteDemote.ts index bc23851a..d39e7fb6 100644 --- a/src/events/mineflayer/chat/promoteDemote.ts +++ b/src/events/mineflayer/chat/promoteDemote.ts @@ -1,28 +1,25 @@ -import Emojis from "../../../util/emojis/chatEmojis"; +import Emojis from "../../../util/emojis"; import { Event } from "../../../interfaces/Event"; -import { HypixelRank } from "../../../interfaces/Ranks"; import { escapeMarkdown } from "discord.js"; -import getRankData from "../../../util/emojis/getRankData"; +import getRankColor from "../../../util/getRankColor"; export default { name: "chat:promoteDemote", runOnce: false, run: async ( bot, - hypixelRank: HypixelRank | undefined, + rank: string | undefined, playerName: string, type: "promoted" | "demoted", guildRankFrom: string, guildRankTo: string, ) => { - const [rank, color] = await getRankData(hypixelRank); - await bot.sendToDiscord( "gc", `${type === "promoted" ? Emojis.positiveGuildEvent : Emojis.negativeGuildEvent} **${ rank ? rank + " " : "" }${escapeMarkdown(playerName)}** was ${type} to ${guildRankTo} from ${guildRankFrom}!`, - color, + getRankColor(rank), true, ); }, diff --git a/src/events/mineflayer/chat/questComplete.ts b/src/events/mineflayer/chat/questComplete.ts index d95a99f4..8747b977 100644 --- a/src/events/mineflayer/chat/questComplete.ts +++ b/src/events/mineflayer/chat/questComplete.ts @@ -1,4 +1,4 @@ -import Emojis from "../../../util/emojis/chatEmojis"; +import Emojis from "../../../util/emojis"; import { Event } from "../../../interfaces/Event"; export default { diff --git a/src/events/mineflayer/chat/questTierComplete.ts b/src/events/mineflayer/chat/questTierComplete.ts index 60b26d80..6b5563bb 100644 --- a/src/events/mineflayer/chat/questTierComplete.ts +++ b/src/events/mineflayer/chat/questTierComplete.ts @@ -1,4 +1,4 @@ -import Emojis from "../../../util/emojis/chatEmojis"; +import Emojis from "../../../util/emojis"; import { Event } from "../../../interfaces/Event"; export default { diff --git a/src/events/mineflayer/handler/kicked.ts b/src/events/mineflayer/handler/kicked.ts index c617d345..a0fad7ec 100644 --- a/src/events/mineflayer/handler/kicked.ts +++ b/src/events/mineflayer/handler/kicked.ts @@ -1,4 +1,4 @@ -import Emojis from "../../../util/emojis/chatEmojis"; +import Emojis from "../../../util/emojis"; import { Event } from "../../../interfaces/Event"; export default { diff --git a/src/events/mineflayer/handler/login.ts b/src/events/mineflayer/handler/login.ts index eac508e5..c29aa021 100644 --- a/src/events/mineflayer/handler/login.ts +++ b/src/events/mineflayer/handler/login.ts @@ -1,4 +1,4 @@ -import Emojis from "../../../util/emojis/chatEmojis"; +import Emojis from "../../../util/emojis"; import { Event } from "../../../interfaces/Event"; export default { diff --git a/src/interfaces/EmojiIds.ts b/src/interfaces/EmojiIds.ts deleted file mode 100644 index b44fa0f7..00000000 --- a/src/interfaces/EmojiIds.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { VerboseHypixelRank } from "./Ranks"; - -export type EmojiIds = { [key in VerboseHypixelRank]?: Emoji[] }; - -export interface Emoji { - name: string; - id: string; -} diff --git a/src/interfaces/Ranks.ts b/src/interfaces/Ranks.ts deleted file mode 100644 index 84e6b39a..00000000 --- a/src/interfaces/Ranks.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* eslint no-shadow: 0 */ - -export enum HypixelRanks { - "[YOUTUBE]", - "[MVP++]", - "[MVP+]", - "[MVP]", - "[VIP+]", - "[VIP]", -} - -export enum VerboseHypixelRanks { - youtube = 0xff5555, - mvpPlusPlus = 0xffaa00, - mvpPlus = 0x55ffff, - mvp = 0x55ffff, - vipPlus = 0x55ff55, - vip = 0x55ff55, -} - -export type HypixelRank = keyof typeof HypixelRanks; -export type VerboseHypixelRank = keyof typeof VerboseHypixelRanks; diff --git a/src/util/_blacklist.json.template b/src/util/blacklist/_blacklist.json.template similarity index 100% rename from src/util/_blacklist.json.template rename to src/util/blacklist/_blacklist.json.template diff --git a/src/util/isUserBlacklisted.ts b/src/util/blacklist/isUserBlacklisted.ts similarity index 74% rename from src/util/isUserBlacklisted.ts rename to src/util/blacklist/isUserBlacklisted.ts index 9441765c..d906ad3d 100644 --- a/src/util/isUserBlacklisted.ts +++ b/src/util/blacklist/isUserBlacklisted.ts @@ -1,4 +1,4 @@ -import { BlacklistEntry } from "../interfaces/BlacklistEntry"; +import { BlacklistEntry } from "../../interfaces/BlacklistEntry"; import _blacklist from "./_blacklist.json"; export default (uuid: string) => { diff --git a/src/util/emojis/chatEmojis.ts b/src/util/emojis.ts similarity index 100% rename from src/util/emojis/chatEmojis.ts rename to src/util/emojis.ts diff --git a/src/util/emojis/_emojiIds.json.template b/src/util/emojis/_emojiIds.json.template deleted file mode 100644 index 9ea0abbd..00000000 --- a/src/util/emojis/_emojiIds.json.template +++ /dev/null @@ -1,8 +0,0 @@ -{ - "youtube": [], - "mvpPlusPlus": [], - "mvpPlus": [], - "mvp": [], - "vipPlus": [], - "vip": [] -} diff --git a/src/util/emojis/getEmojiBuffers.ts b/src/util/emojis/getEmojiBuffers.ts deleted file mode 100644 index bfb8e388..00000000 --- a/src/util/emojis/getEmojiBuffers.ts +++ /dev/null @@ -1,17 +0,0 @@ -import fs from "fs/promises"; -import path from "path"; -import recursiveWalkDir from "../recursiveWalkDir"; - -export default async () => { - const buffers: { [key: string]: Buffer } = {}; - - const callback = async (currentDir: string, file: string) => { - const name = file.split(".")[0] as string; - const buffer = await fs.readFile(path.join(currentDir, file)); - buffers[name] = buffer; - }; - - await recursiveWalkDir(path.join(__dirname, "./images"), callback, "Error while fetching image buffers: "); - - return buffers; -}; diff --git a/src/util/emojis/getRankData.ts b/src/util/emojis/getRankData.ts deleted file mode 100644 index 4bff573d..00000000 --- a/src/util/emojis/getRankData.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { HypixelRank, VerboseHypixelRank, VerboseHypixelRanks } from "../../interfaces/Ranks"; -import { ColorResolvable } from "discord.js"; -import { EmojiIds } from "../../interfaces/EmojiIds"; -import _emojiIds from "./_emojiIds.json"; - -export default async (rank: HypixelRank | undefined): Promise<[rank: string, color: ColorResolvable | undefined]> => { - const emojiIds = _emojiIds as EmojiIds; - let rankName: VerboseHypixelRank; - - if (!rank) { - return ["", 0xaaaaaa]; - } - - switch (rank) { - case "[VIP]": - rankName = "vip"; - break; - case "[VIP+]": - rankName = "vipPlus"; - break; - case "[MVP]": - rankName = "mvp"; - break; - case "[MVP+]": - rankName = "mvpPlus"; - break; - case "[MVP++]": - rankName = "mvpPlusPlus"; - break; - case "[YOUTUBE]": - rankName = "youtube"; - break; - default: - return [rank, undefined]; - } - - const emojis = emojiIds[rankName]; - if (process.env.USE_RANK_EMOJIS === "true" && emojis !== undefined) { - return [ - `${emojis.reduce((acc, emoji) => (acc += `<:${emoji.name}:${emoji.id}>`), "")} `, - VerboseHypixelRanks[rankName], - ]; - } - - return [rank, VerboseHypixelRanks[rankName]]; -}; diff --git a/src/util/emojis/images/mvp++/mvpPlusPlus1.png b/src/util/emojis/images/mvp++/mvpPlusPlus1.png deleted file mode 100644 index 8e550039..00000000 Binary files a/src/util/emojis/images/mvp++/mvpPlusPlus1.png and /dev/null differ diff --git a/src/util/emojis/images/mvp++/mvpPlusPlus2.png b/src/util/emojis/images/mvp++/mvpPlusPlus2.png deleted file mode 100644 index 60cf08e1..00000000 Binary files a/src/util/emojis/images/mvp++/mvpPlusPlus2.png and /dev/null differ diff --git a/src/util/emojis/images/mvp++/mvpPlusPlus3.png b/src/util/emojis/images/mvp++/mvpPlusPlus3.png deleted file mode 100644 index 977e71e2..00000000 Binary files a/src/util/emojis/images/mvp++/mvpPlusPlus3.png and /dev/null differ diff --git a/src/util/emojis/images/mvp++/mvpPlusPlus4.png b/src/util/emojis/images/mvp++/mvpPlusPlus4.png deleted file mode 100644 index 28125b4c..00000000 Binary files a/src/util/emojis/images/mvp++/mvpPlusPlus4.png and /dev/null differ diff --git a/src/util/emojis/images/mvp+/mvpPlus1.png b/src/util/emojis/images/mvp+/mvpPlus1.png deleted file mode 100644 index 0f5d317f..00000000 Binary files a/src/util/emojis/images/mvp+/mvpPlus1.png and /dev/null differ diff --git a/src/util/emojis/images/mvp+/mvpPlus2.png b/src/util/emojis/images/mvp+/mvpPlus2.png deleted file mode 100644 index 3bf3cd62..00000000 Binary files a/src/util/emojis/images/mvp+/mvpPlus2.png and /dev/null differ diff --git a/src/util/emojis/images/mvp+/mvpPlus3.png b/src/util/emojis/images/mvp+/mvpPlus3.png deleted file mode 100644 index 6e8e56ae..00000000 Binary files a/src/util/emojis/images/mvp+/mvpPlus3.png and /dev/null differ diff --git a/src/util/emojis/images/mvp+/mvpPlus4.png b/src/util/emojis/images/mvp+/mvpPlus4.png deleted file mode 100644 index f26d7c21..00000000 Binary files a/src/util/emojis/images/mvp+/mvpPlus4.png and /dev/null differ diff --git a/src/util/emojis/images/mvp/mvp1.png b/src/util/emojis/images/mvp/mvp1.png deleted file mode 100644 index d6d4aac2..00000000 Binary files a/src/util/emojis/images/mvp/mvp1.png and /dev/null differ diff --git a/src/util/emojis/images/mvp/mvp2.png b/src/util/emojis/images/mvp/mvp2.png deleted file mode 100644 index c615c079..00000000 Binary files a/src/util/emojis/images/mvp/mvp2.png and /dev/null differ diff --git a/src/util/emojis/images/mvp/mvp3.png b/src/util/emojis/images/mvp/mvp3.png deleted file mode 100644 index 1840109e..00000000 Binary files a/src/util/emojis/images/mvp/mvp3.png and /dev/null differ diff --git a/src/util/emojis/images/vip+/vipPlus1.png b/src/util/emojis/images/vip+/vipPlus1.png deleted file mode 100644 index 95d682cc..00000000 Binary files a/src/util/emojis/images/vip+/vipPlus1.png and /dev/null differ diff --git a/src/util/emojis/images/vip+/vipPlus2.png b/src/util/emojis/images/vip+/vipPlus2.png deleted file mode 100644 index 00102ee9..00000000 Binary files a/src/util/emojis/images/vip+/vipPlus2.png and /dev/null differ diff --git a/src/util/emojis/images/vip+/vipPlus3.png b/src/util/emojis/images/vip+/vipPlus3.png deleted file mode 100644 index 14c78ee7..00000000 Binary files a/src/util/emojis/images/vip+/vipPlus3.png and /dev/null differ diff --git a/src/util/emojis/images/vip/vip1.png b/src/util/emojis/images/vip/vip1.png deleted file mode 100644 index 9e9c9b2a..00000000 Binary files a/src/util/emojis/images/vip/vip1.png and /dev/null differ diff --git a/src/util/emojis/images/vip/vip2.png b/src/util/emojis/images/vip/vip2.png deleted file mode 100644 index 09e75c54..00000000 Binary files a/src/util/emojis/images/vip/vip2.png and /dev/null differ diff --git a/src/util/emojis/images/vip/vip3.png b/src/util/emojis/images/vip/vip3.png deleted file mode 100644 index b79c6f13..00000000 Binary files a/src/util/emojis/images/vip/vip3.png and /dev/null differ diff --git a/src/util/emojis/images/youtube/youtube1.png b/src/util/emojis/images/youtube/youtube1.png deleted file mode 100644 index 9bdf7d2e..00000000 Binary files a/src/util/emojis/images/youtube/youtube1.png and /dev/null differ diff --git a/src/util/emojis/images/youtube/youtube2.png b/src/util/emojis/images/youtube/youtube2.png deleted file mode 100644 index 93a4659d..00000000 Binary files a/src/util/emojis/images/youtube/youtube2.png and /dev/null differ diff --git a/src/util/emojis/images/youtube/youtube3.png b/src/util/emojis/images/youtube/youtube3.png deleted file mode 100644 index a4cfe8b6..00000000 Binary files a/src/util/emojis/images/youtube/youtube3.png and /dev/null differ diff --git a/src/util/emojis/images/youtube/youtube4.png b/src/util/emojis/images/youtube/youtube4.png deleted file mode 100644 index d34164ba..00000000 Binary files a/src/util/emojis/images/youtube/youtube4.png and /dev/null differ diff --git a/src/util/emojis/images/youtube/youtube5.png b/src/util/emojis/images/youtube/youtube5.png deleted file mode 100644 index 70d91e88..00000000 Binary files a/src/util/emojis/images/youtube/youtube5.png and /dev/null differ diff --git a/src/util/getRankColor.ts b/src/util/getRankColor.ts new file mode 100644 index 00000000..e2f988cd --- /dev/null +++ b/src/util/getRankColor.ts @@ -0,0 +1,22 @@ +export default (rank?: string) => { + let color = undefined; + + switch (rank) { + case "[ADMIN]": + case "[YOUTUBE]": + color = 0xff5555; + break; + case "[MVP++]": + color = 0xffaa00; + break; + case "[MVP+]": + case "[MVP]": + color = 0x55ffff; + break; + case "[VIP+]": + case "[VIP]": + color = 0x55ff55; + } + + return color; +};