Fixed "getFeatured" and added getStats
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -30,7 +30,7 @@ def follow(target, toggle):
|
||||
|
||||
return 0
|
||||
|
||||
def GetFeatured():
|
||||
def getFeatured():
|
||||
print(f"{ORANGE}MacaroniPM: The featured function is stil being worked on. It is recomended {Effect.BOLD}{Effect.UNDERLINE}NOT{Effect.OFF}{ORANGE} to use this.{Effect.OFF}")
|
||||
url = f"https://projects.penguinmod.com/api/v1/projects/searchprojects?page=0&query=&type=featured&token={TOKEN}&reverse=false"
|
||||
|
||||
@@ -42,4 +42,17 @@ def GetFeatured():
|
||||
print(f"Response from url: {Effect.BOLD}{Effect.UNDERLINE}{json.loads(response.content.decode())["error"]}{Effect.OFF}")
|
||||
return -1
|
||||
|
||||
return response.text.split()
|
||||
return response.text.split()
|
||||
|
||||
def getStats():
|
||||
url = f"https://projects.penguinmod.com/api/v1/misc/getStats"
|
||||
|
||||
response = requests.get(url)
|
||||
|
||||
if not response.status_code == 200:
|
||||
print(f"{Color.RED}Something went wrong!")
|
||||
print(f"Status code: {response.status_code}")
|
||||
print(f"Response from url: {Effect.BOLD}{Effect.UNDERLINE}{json.loads(response.content.decode())["error"]}{Effect.OFF}")
|
||||
return -1
|
||||
|
||||
return json.loads(response.content)
|
||||
@@ -3,4 +3,4 @@ import macaronipm
|
||||
macaronipm.misc.setToken("6e5035471364acbbdb523dd05e903ccd48c3a60ea6d5ec14c485a833dccf555f")
|
||||
macaronipm.misc.setProject("5284710295")
|
||||
|
||||
print(macaronipm.user.getUnreadMessages())
|
||||
print(macaronipm.misc.getStats())
|
||||
Reference in New Issue
Block a user