1. Asume

    Asume Active Member

    MerryAsume
    MVP++
    Infamy INFAMY
    Adviser
    Messages:
    674
    Hi, so i'm using node js to make my Discord bot, and I'm trying to use the Hypixel API to get info about a player, e.g. their aliases.
    I'm using the hypixel-api package (https://www.npmjs.com/package/hypixel-api)

    Code:
     const HypixelAPI = require('hypixel-api')
    
    const client = new HypixelAPI('-----')
    
    client.getPlayer('name', 'asume').then((player) => {
    
            console.log(player.achievements);
    
    }).catch((err) => {
            console.log(err)
    }) 
    When I execute the command, it just returns 'undefined' in the console. 'player' by itself returns all the info about the player, but i'm trying to filter the JSON by just achievements. Is there any way to do this?
     
    #1
  2. powns

    powns Well-Known Member

    powns
    MVP++
    Messages:
    3,408
    Could you possibly post an example JSON response here + the code used to parse this response?
     
    #2
  3. Asume

    Asume Active Member

    MerryAsume
    MVP++
    Infamy INFAMY
    Adviser
    Messages:
    674
    issue solved thanks powns!
     
    #3
    • Hype Train Hype Train x 1

Share This Page