Skip to content

Commit c12c2e4

Browse files
authored
Merge pull request #2 from iranathan/master
[Groups] Add getUserRole and getGroupRoles
2 parents 5c6c0c3 + 0b2ee9a commit c12c2e4

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

pyblox/api/groups.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,23 @@ def getGroup(groupid):
4141
# GET /groups/{groupId}/allies
4242
# Returns Table/Array with each ally's attributes
4343
def getGroupAllies(groupid):
44-
a = Http.sendRequest("https://api.roblox.com/groups/" + str(groupid) + "allies")
44+
a = Http.sendRequest("https://api.roblox.com/groups/" + str(groupid) + "/allies")
4545
return a
4646

4747
# GET /groups/{groupId}/enemies
4848
# Returns Table/Array with each enemy's attributes
4949
def getGroupEnemies(groupid):
50-
a = Http.sendRequest("https://api.roblox.com/groups/" + str(groupid) + "enemies")
50+
a = Http.sendRequest("https://api.roblox.com/groups/" + str(groupid) + "/enemies")
51+
return a
52+
53+
# GET /groups/{groupId}/roles
54+
# Returns a Table/Array with each role.
55+
def getGroupRoles(groupid):
56+
a = Http.sendRequest("https://groups.roblox.com/v1/groups/" + str(groupid) + "/roles")
57+
return a
58+
59+
# GET /Game/LuaWebService/HandleSocialRequest.ashx
60+
# Returns String with role name.
61+
def getUserRole(groupid, userid):
62+
a = Http.sendRequest(f"https://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRole&playerid={userid}&groupId={groupid}")
5163
return a

0 commit comments

Comments
 (0)