1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Checking Hypixel API

Discussion in 'Skript' started by MattyNJ, Jul 8, 2020.

Thread Status:
Not open for further replies.
  1. MattyNJ

    MattyNJ Member

    Joined:
    Jul 8, 2020
    Messages:
    2
    Likes Received:
    0
    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 (Text):
    1. discord command -ginfo <text>:
    2.   trigger:
    3.     send request to url("https://api.hypixel.net/player?key={@APIKey}&name=%arg-1%")
    4.     map json body of last http response to {_results::*}
    5.     set {_u} to {_results::player::uuid}
    6.     send request to url("https://api.hypixel.net/guild?key={@APIKey}&player=%{_u}%")
    7.     map json body of last http response to {_results2::*}
    8.     set {_pn} to arg-1
    9.     set {_gn} to {_results2::guild::name}
    10.     set {_gr} to {_results2::guild::members::uuid::%{_u}%::rank}
    11.         set {_gr} to "Test"
    12.         stop loop
    13.     create embed:
    14.       set color of the embed to green
    15.       set title of the embed to "%arg-1% Guild Stats"
    16.       set description of the embed to "Name: %{_pn}%%newline%Guild: %{_gn}%%newline%Rank: %{_gr}%"
    17.       set icon of the embed to "https://crafatar.com/renders/head/%{_u}%?overlay"
    18.       set footer of embed to "Renders provided by crafatar.com"
    19.     reply with the last made embed
    All it does is return none for the red part of the code.
     
    #1 MattyNJ, Jul 8, 2020
    Last edited: Jul 8, 2020
  2. novastosha

    novastosha Well-Known Member

    Joined:
    Jan 11, 2019
    Messages:
    344
    Likes Received:
    22
    You dumb guy, you shall never share your API key, request a new one!
     
  3. MattyNJ

    MattyNJ Member

    Joined:
    Jul 8, 2020
    Messages:
    2
    Likes Received:
    0
    I got a new key, but how will other people know how the API works?
     
Thread Status:
Not open for further replies.

Share This Page

Loading...