Skip to content

Commit

Permalink
Merge pull request #2 from iranathan/master
Browse files Browse the repository at this point in the history
[Groups] Add getUserRole and getGroupRoles
  • Loading branch information
Sanjay-B authored Apr 30, 2019
2 parents 5c6c0c3 + 0b2ee9a commit c12c2e4
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions pyblox/api/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,23 @@ def getGroup(groupid):
# GET /groups/{groupId}/allies
# Returns Table/Array with each ally's attributes
def getGroupAllies(groupid):
a = Http.sendRequest("https://api.roblox.com/groups/" + str(groupid) + "allies")
a = Http.sendRequest("https://api.roblox.com/groups/" + str(groupid) + "/allies")
return a

# GET /groups/{groupId}/enemies
# Returns Table/Array with each enemy's attributes
def getGroupEnemies(groupid):
a = Http.sendRequest("https://api.roblox.com/groups/" + str(groupid) + "enemies")
a = Http.sendRequest("https://api.roblox.com/groups/" + str(groupid) + "/enemies")
return a

# GET /groups/{groupId}/roles
# Returns a Table/Array with each role.
def getGroupRoles(groupid):
a = Http.sendRequest("https://groups.roblox.com/v1/groups/" + str(groupid) + "/roles")
return a

# GET /Game/LuaWebService/HandleSocialRequest.ashx
# Returns String with role name.
def getUserRole(groupid, userid):
a = Http.sendRequest(f"https://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRole&playerid={userid}&groupId={groupid}")
return a

0 comments on commit c12c2e4

Please sign in to comment.