Checking Hypixel API

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

MattyNJ

Member
Jul 8, 2020
2
0
1
25
So I'm making a discord bot for my Hypixel guild's discord. (I don't know other languages.) I want to be able to check Hypixel's API and grab the Guild ranks, and I know how to get to the API with Reqn and Sk-Json as I've gotten the other things from the API, jus the issue is with getting ranks.
Code:
discord command -ginfo <text>:
  trigger:
    send request to url("https://api.hypixel.net/player?key={@APIKey}&name=%arg-1%")
    map json body of last http response to {_results::*}
    set {_u} to {_results::player::uuid}
    send request to url("https://api.hypixel.net/guild?key={@APIKey}&player=%{_u}%")
    map json body of last http response to {_results2::*}
    set {_pn} to arg-1
    set {_gn} to {_results2::guild::name}
    set {_gr} to {_results2::guild::members::uuid::%{_u}%::rank}
        set {_gr} to "Test"
        stop loop
    create embed:
      set color of the embed to green
      set title of the embed to "%arg-1% Guild Stats"
      set description of the embed to "Name: %{_pn}%%newline%Guild: %{_gn}%%newline%Rank: %{_gr}%"
      set icon of the embed to "https://crafatar.com/renders/head/%{_u}%?overlay"
      set footer of embed to "Renders provided by crafatar.com"
    reply with the last made embed
All it does is return none for the red part of the code.
 
Last edited:
Status
Not open for further replies.