@@ -2,13 +2,13 @@ const { formatNumber, replaceVariables } = require("../../contracts/helperFuncti
22const { getLatestProfile } = require ( "../../../API/functions/getLatestProfile.js" ) ;
33const HypixelDiscordChatBridgeError = require ( "../../contracts/errorHandler.js" ) ;
44const { SuccessEmbed, ErrorEmbed } = require ( "../../contracts/embedHandler.js" ) ;
5- const getChocolateFactory = require ( "../../../API/stats/chocolateFactory.js" ) ;
5+ const { getChocolateFactory } = require ( "../../../API/stats/chocolateFactory.js" ) ;
66const hypixelRebornAPI = require ( "../../contracts/API/HypixelRebornAPI.js" ) ;
7- const getDungeons = require ( "../../../API/stats/dungeons .js" ) ;
8- const getCrimson = require ( "../../../API/stats/crimson .js" ) ;
9- const getSkills = require ( "../../../API/stats/skills .js" ) ;
10- const getSlayer = require ( "../../../API/stats/slayer .js" ) ;
11- const getJacob = require ( "../../../API/stats/jacob.js" ) ;
7+ const { getCrimsonIsle } = require ( "../../../API/stats/crimson .js" ) ;
8+ const { getDungeons } = require ( "../../../API/stats/dungeons .js" ) ;
9+ const { getSlayer } = require ( "../../../API/stats/slayer .js" ) ;
10+ const { getSkills } = require ( "../../../API/stats/skills .js" ) ;
11+ const { getJacob } = require ( "../../../API/stats/jacob.js" ) ;
1212const { getNetworth } = require ( "skyhelper-networth" ) ;
1313const config = require ( "../../../config.json" ) ;
1414const { readFileSync } = require ( "fs" ) ;
@@ -41,7 +41,7 @@ module.exports = {
4141
4242 const uuid = linked [ interaction . user . id ] ;
4343
44- const roles = [ config . verification . guildMemberRole , ...config . verification . ranks . map ( ( r ) => r . role ) , ...config . verification . levelRoles . map ( ( r ) => r . roleId ) ] ;
44+ const roles = [ config . verification . guildMemberRole , ...config . verification . ranks . flatMap ( ( r ) => r . roles ) , ...config . verification . levelRoles . map ( ( r ) => r . roleId ) ] ;
4545 const giveRoles = [ ] ;
4646
4747 if ( uuid === undefined ) {
@@ -73,7 +73,7 @@ module.exports = {
7373 sbProfile ? getSkills ( sbProfile . profile , sbProfile . profileData ) : null ,
7474 sbProfile ? getSlayer ( sbProfile . profile ) : null ,
7575 sbProfile ? getDungeons ( sbProfile . profile ) : null ,
76- sbProfile ? getCrimson ( sbProfile . profile ) : null ,
76+ sbProfile ? getCrimsonIsle ( sbProfile . profile ) : null ,
7777 sbProfile
7878 ? getNetworth ( sbProfile . profile , sbProfile . profileData ?. banking ?. balance || 0 , {
7979 onlyNetworth : true ,
@@ -97,14 +97,10 @@ module.exports = {
9797 if ( config . verification . ranks . length > 0 && guildMember . rank ) {
9898 const rank = config . verification . ranks . find ( ( r ) => r . name . toLowerCase ( ) == guildMember . rank . toLowerCase ( ) ) ;
9999 if ( rank ) {
100- for ( const role of config . verification . ranks ) {
101- if ( interaction . member . roles . cache . has ( role . role ) ) {
102- await interaction . member . roles . remove ( role . role , "Updated Roles" ) ;
103- }
100+ for ( const role of rank . roles ) {
101+ giveRoles . push ( role ) ;
102+ await interaction . member . roles . add ( role , "Updated Roles" ) ;
104103 }
105-
106- giveRoles . push ( rank . role ) ;
107- await interaction . member . roles . add ( rank . role , "Updated Roles" ) ;
108104 }
109105 }
110106 } else {
@@ -198,7 +194,7 @@ module.exports = {
198194 skyblockSlayerBlazeXp : slayer ?. blaze ?. xp || 0 ,
199195 skyblockSlayerVampireXp : slayer ?. vampire ?. xp || 0 ,
200196
201- skyblockDungeonsSecrets : dungeons ?. secrets_found || 0 ,
197+ skyblockDungeonsSecrets : dungeons ?. secretsFound || 0 ,
202198 skyblockDungeonsXp : dungeons ?. catacombs ?. skill ?. xp || 0 ,
203199 skyblockDungeonsLevel : dungeons ?. catacombs ?. skill ?. level || 0 ,
204200
@@ -281,16 +277,16 @@ module.exports = {
281277 skyblockJacobPerksLevelCap : jacob ?. perks ?. levelCap || 0 ,
282278 skyblockJacobPerksDoubleDrops : jacob ?. perks ?. doubleDrops || 0 ,
283279
284- skyblockJacobPersonalBestNetherWart : jacob ?. personalBests ?. netherWart || 0 ,
285- skyblockJacobPersonalBestCocoBeans : jacob ?. personalBests ?. cocoBeans || 0 ,
280+ skyblockJacobPersonalBestNetherWart : jacob ?. personalBests ?. nether_wart || 0 ,
281+ skyblockJacobPersonalBestCocoBeans : jacob ?. personalBests ?. coco_beans || 0 ,
286282 skyblockJacobPersonalBestMushroom : jacob ?. personalBests ?. mushroom || 0 ,
287283 skyblockJacobPersonalBestWheat : jacob ?. personalBests ?. wheat || 0 ,
288284 skyblockJacobPersonalBestPotato : jacob ?. personalBests ?. potato || 0 ,
289285 skyblockJacobPersonalBestPumpkin : jacob ?. personalBests ?. pumpkin || 0 ,
290286 skyblockJacobPersonalBestCarrot : jacob ?. personalBests ?. carrot || 0 ,
291287 skyblockJacobPersonalBestCactus : jacob ?. personalBests ?. cactus || 0 ,
292288 skyblockJacobPersonalBestMelon : jacob ?. personalBests ?. melon || 0 ,
293- skyblockJacobPersonalBestSugarCane : jacob ?. personalBests ?. sugarCane || 0
289+ skyblockJacobPersonalBestSugarCane : jacob ?. personalBests ?. sugar_cane || 0
294290 } ;
295291
296292 stats [ "skyblockSkillsAverageLevel" ] = (
@@ -383,7 +379,7 @@ module.exports = {
383379 ) ;
384380
385381 for ( const role of roles ) {
386- if ( giveRoles . includes ( role ) ) return ;
382+ if ( giveRoles . includes ( role ) ) continue ;
387383 if ( interaction . member . roles . cache . has ( role ) ) await interaction . member . roles . remove ( role , "Updated Roles" ) ;
388384 }
389385
0 commit comments