Save all high score users

This commit is contained in:
Dragon Fire
2021-01-17 12:08:45 -05:00
parent 983544c1cd
commit a1a6021e00
7 changed files with 66 additions and 41 deletions
+15
View File
@@ -271,6 +271,21 @@ module.exports = class Util {
return verify.map(player => player.author.id);
}
static async fetchHSUserDisplay(client, userID) {
let user;
if (userID) {
try {
const fetched = await client.users.fetch(userID);
user = fetched.tag;
} catch {
user = 'Unknown';
}
} else {
user = 'no one';
}
return user;
}
static cleanAnilistHTML(html, removeLineBreaks = true) {
let clean = html;
if (removeLineBreaks) clean = clean.replace(/\r|\n|\f/g, '');