Skip to content

Commit 3ee86d6

Browse files
committed
[Groups] Integration of some stuff, quality of life
1 parent 4ab00a4 commit 3ee86d6

File tree

3 files changed

+41
-22
lines changed

3 files changed

+41
-22
lines changed
647 Bytes
Binary file not shown.

pyblox3/src/groups.py

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ def __init__(self,**kwargs):
2323
self.socialLinks = self.socialLinks(self)
2424
self.Wall = self.Wall(self)
2525
self.Roles = self.Roles(self)
26-
26+
27+
# Url : "https://groups.roblox.com/v1/groups/{grouid}
2728
async def get(self,**kwargs):
2829
groupid = self.groupid
2930
fetchObject = kwargs.get("Object",None)
@@ -38,7 +39,8 @@ async def get(self,**kwargs):
3839

3940
elif result != None and not fetchObject:
4041
return result
41-
42+
43+
# Url : "https://groups.roblox.com/v1/groups/{groupid}/payouts"
4244
async def payoutsInfo(self,**kwargs):
4345
groupid = self.groupid
4446
response = await Req.request(t="GET",url=root+"/v1/groups/"+str(groupid)+"/payouts")
@@ -50,11 +52,16 @@ async def payoutsInfo(self,**kwargs):
5052
print("You don't have permission to view this group's payouts")
5153
else:
5254
return json.loads(response[1].decode('utf-8'))
53-
55+
# Url : "https://groups.roblox.com/v1
5456
#def relationship(**kwargs): # Requires token validation
57+
58+
# Url : "https://groups.roblox.com/v1
5559
#def relationshipRequests(): # Requires token validation
60+
61+
# Url : "https://groups.roblox.com/v1
5662
#def create(): # Requires token validation
5763

64+
# Url : "https://groups.roblox.com/v1/groups/metdata"
5865
async def metadata(self):
5966
response = await Req.request(t="GET",url=root+"/v1/groups/metadata")
6067
if response[0] == 200:
@@ -68,7 +75,8 @@ class Membership:
6875

6976
def __init__(self,Groups_v1):
7077
self.Groups_v1 = Groups_v1
71-
78+
79+
# Url : "https://groups.roblox.com/v1/groups/{groupid}/membership
7280
async def get(self,**kwargs):
7381
groupid = self.Groups_v1.groupid
7482
response = await Req.request(t="GET",url=root+"/v1/groups/"+str(groupid)+"/membership")
@@ -77,6 +85,7 @@ async def get(self,**kwargs):
7785
elif response[0] == 400:
7886
print("The group is invalid or does not exist")
7987

88+
# Url : "https://groups.roblox.com/v1/groups/{groupid}/roles
8089
async def roles(self,**kwargs):
8190
groupid = self.Groups_v1.groupid
8291
response = await Req.request(t="GET",url=root+"/v1/groups/"+str(groupid)+"/roles")
@@ -88,6 +97,7 @@ async def roles(self,**kwargs):
8897
#def role(**kwargs): # Doesn't work for some odd reason
8998
#def pending(**kwargs): # Requires token validation
9099

100+
# Url : "https://groups.roblox.com/v1/users/{userid}/group-membership-status
91101
async def status(self,**kwargs):
92102
userid = kwargs.get("userid",None)
93103
response = await Req.request(t="GET",url=root+"/v1/users/"+str(userid)+"/group-membership-status")
@@ -96,6 +106,7 @@ async def status(self,**kwargs):
96106
elif response[0] == 400:
97107
print("The user is invalid or does not exist")
98108

109+
# Url : "https://groups.roblox.com/v1/users/{userid}/groups/roles
99110
async def allUserRoles(self,**kwargs):
100111
userid = kwargs.get("userid",None)
101112
response = await Req.request(t="GET",url=root+"/v1/users/"+str(userid)+"/groups/roles")
@@ -104,6 +115,7 @@ async def allUserRoles(self,**kwargs):
104115
elif response[0] == 400:
105116
print("The user is invalid or does not exist")
106117

118+
# Url : "https://groups.roblox.com/groups/{groupid}/joinrequests-html?pageNum=1
107119
async def getJoinRequests(self,**kwargs):
108120
groupid = self.Groups_v1.groupid
109121
response = await Req.request(t='GET', url='https://www.roblox.com/groups/'+str(groupid)+'/joinrequests-html?pageNum=1')
@@ -124,6 +136,7 @@ async def getJoinRequests(self,**kwargs):
124136
})
125137
return requests
126138

139+
# Url : "https://groups.roblox.com/group/handle-join-request
127140
async def declineJoinRequest(self,**kwargs):
128141
requestid = kwargs.get('requestid', None)
129142
url = 'https://www.roblox.com/group/handle-join-request'
@@ -134,6 +147,7 @@ async def declineJoinRequest(self,**kwargs):
134147
response = await Req.request(t='POST', url=url, payload=data)
135148
return response[0]
136149

150+
# Url : "https://groups.roblox.com/group/handle-join-request
137151
async def acceptJoinRequest(self,**kwargs):
138152
requestid = kwargs.get('requestid', None)
139153
url = 'https://www.roblox.com/group/handle-join-request'
@@ -155,6 +169,7 @@ class Revenue:
155169
def __init__(self,Groups_v1):
156170
self.Groups_v1 = Groups_v1
157171

172+
# Url : "https://groups.roblox.com/v1/groups/{groupid}/payouts
158173
async def payoutPercentages(self,**kwargs): #Doesn't work for some reason
159174
groupid = kwargs.get("groupid",None)
160175
cache = kwargs.get("cache",None)
@@ -176,6 +191,7 @@ class Relationships:
176191
def __init__(self,Groups_v1):
177192
self.Groups_v1 = Groups_v1
178193

194+
# Url : "https://groups.roblox.com/v1/groups/{groupid}/relationship/{groupRelationshipType}/?model.startRowIndex={startRowIndex}&model.maxRows={maxRows}
179195
async def get(self,**kwargs):
180196
groupid = self.Groups_v1.groupid
181197
groupRelationshipType = kwargs.get("groupRelationshipType",None)
@@ -202,6 +218,7 @@ class Permissions:
202218
def __init__(self,Groups_v1):
203219
self.Groups_v1 = Groups_v1
204220

221+
# Url : "https://groups.roblox.com/v1/groups/{groupid}/roles/{rolesetid}/permissions
205222
async def get(self,**kwargs):
206223
groupid = self.Groups_v1.groupid
207224
rolesetid = kwargs.get("rolesetid",None)
@@ -215,6 +232,7 @@ async def get(self,**kwargs):
215232
elif response[0] == 403:
216233
print("You are not authorized to view/edit permissions for this roleset")
217234

235+
# Url : "https://groups.roblox.com/v1/groups/{groupid}/roles/guest/permissions
218236
async def guest(self,**kwargs):
219237
groupid = self.Groups_v1.groupid
220238
response = await Req.request(t="GET",url=root+"/v1/groups/"+str(groupid)+"/roles/guest/permissions")
@@ -228,6 +246,7 @@ class socialLinks:
228246
def __init__(self,Groups_v1):
229247
self.Groups_v1 = Groups_v1
230248

249+
# Url : "https://groups.roblox.com/v1/groups/{groupid}/social-links
231250
async def get(self,**kwargs): # Authorization denied for this request
232251
groupid = self.Groups_v1.groupid
233252
response = await Req.request(t="GET",url=root+"/v1/groups/"+str(groupid)+"/social-links")
@@ -251,6 +270,7 @@ class Wall:
251270
def __init__(self,Groups_v1):
252271
self.Groups_v1 = Groups_v1
253272

273+
# Url : "https://groups.roblox.com/v1/groups/{groupid}/wall/posts?sortOrder=Asc&limit=10
254274
async def getNextCursor(self,**kwargs):
255275
groupid = self.Groups_v1.groupid
256276
cursor = kwargs.get("cursor",None)
@@ -261,6 +281,7 @@ async def getNextCursor(self,**kwargs):
261281
else:
262282
return None
263283

284+
# Url : "https://groups.roblox.com/v1/groups/{groupid}/wall/posts?sortOrder=Asc&limit=10
264285
async def get(self,**kwargs):
265286
groupid = self.Groups_v1.groupid
266287
cursor = kwargs.get("cursor",None)
@@ -281,6 +302,7 @@ async def get(self,**kwargs):
281302
elif response[0] == 403:
282303
print("You do not have permission to access this group wall")
283304

305+
# Url : "https://groups.roblox.com/v1/groups/{groupid}/wall/posts
284306
async def post(self,**kwargs):
285307
groupid = self.Groups_v1.groupid
286308
body = kwargs.get("body",None)
@@ -296,6 +318,7 @@ async def post(self,**kwargs):
296318
elif response[0] == 429:
297319
print("You are posting too fast, please try again in a few minutes")
298320

321+
# Url : "https://groups.roblox.com/v1/groups/{groupid}/wall/posts/{postid}
299322
async def delete(self,**kwargs):
300323
groupid = self.Groups_v1.groupid
301324
postid = kwargs.get("postid",None)
@@ -309,6 +332,7 @@ async def delete(self,**kwargs):
309332
elif response[0] == 403:
310333
print("Token Validation Failed or you do not have permission to access this group wall")
311334

335+
# Url : "https://groups.roblox.com/v1/groups/{groupid}/wall/users/{userid}/posts
312336
async def purgeDelete(self,**kwargs):
313337
groupid = self.Groups_v1.groupid
314338
userid = kwargs.get("userid",None)
@@ -327,6 +351,7 @@ class Roles:
327351
def __init__(self,Groups_v1):
328352
self.Groups_v1 = Groups_v1
329353

354+
# Url : "https://groups.roblox.com/v1/roles/?id={roleid}
330355
async def roles(self,**kwargs):
331356
roleid = kwargs.get("roleid",None)
332357
response = await Req.request(t="GET",url=root+"/v1/roles/?ids="+str(roleid))

setup.py

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,25 @@
22
setup(
33
name = 'pyblox3',
44
packages = ['pyblox', 'robloxapi.utils', 'robloxapi.classes'],
5-
version = '4',
5+
version = '3.0.0',
66
license='MIT',
7-
description = 'A Python wrapper for roblox',
7+
description = 'An API wrapper for Roblox written in Python.',
88
long_description = '''
9-
Just another wrapper for the roblox api.
10-
github: https://github.com/iranathan/robloxapi
11-
docs: https://robloxapi.readthedocs.io/en/latest/ (not the full package is documented will be soon.)
12-
13-
There is also an async version on the github.
9+
An API wrapper for Roblox written in Python.
10+
Full async/non-blocking I/O architecture aiming towards 100% API coverage.
1411
''',
15-
url = 'https://github.com/iranathan/robloxapi',
16-
author = 'Iranathan',
17-
author_email = '[email protected]',
18-
keywords = ['python_roblox', 'roblox', 'robloxapi'],
19-
install_requires=[
20-
'requests',
21-
'beautifulsoup4'
22-
],
12+
url = 'https://github.com/RbxAPI/Pyblox/tree/nightly_build',
13+
author = 'Sanjay Bhadra (Sanjay-B)',
14+
author_email = 'n/a',
15+
keywords = ['api', 'roblox', 'roblox-api', 'python-api', 'pyblox', 'pyblox3'],
16+
install_requires=['requests', 'aiohttp', 'asyncio', 'requests_async','beautifulsoup4'], # Replace with requirements.txt
2317
classifiers=[
24-
'Development Status :: 3 - Alpha',
18+
'Development Status :: 3',
2519

2620
'Intended Audience :: Developers',
2721
'Topic :: Software Development :: Build Tools',
2822

29-
'License :: OSI Approved :: MIT License',
30-
'Programming Language :: Python :: 3.6',
23+
'License :: MIT License',
24+
'Programming Language :: Python :: 3.7',
3125
],
3226
)

0 commit comments

Comments
 (0)