Skip to content

basegroup

This file contains the BaseGroup object, which represents a Roblox group ID. It also contains the GroupSettings object, which represents a group's settings.

BaseGroup

Bases: BaseItem

Represents a Roblox group ID.

Attributes:

Name Type Description
id int

The group's ID.

Source code in roblox/bases/basegroup.py
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
class BaseGroup(BaseItem):
    """
    Represents a Roblox group ID.

    Attributes:
        id: The group's ID.
    """

    def __init__(self, client: Client, group_id: int):
        """
        Parameters:
            client: The Client this object belongs to.
            group_id: The group's ID.
        """
        self._client: Client = client
        self.id: int = group_id

    async def get_settings(self) -> GroupSettings:
        """
        Gets all the settings of the selected group

        Returns:
            The group's settings.
        """
        settings_response = await self._client.requests.get(
            url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/settings"),
        )
        settings_data = settings_response.json()
        return GroupSettings(
            client=self._client,
            data=settings_data
        )

    async def update_settings(
            self,
            is_approval_required: Optional[bool] = None,
            is_builders_club_required: Optional[bool] = None,
            are_enemies_allowed: Optional[bool] = None,
            are_group_funds_visible: Optional[bool] = None,
            are_group_games_visible: Optional[bool] = None,
    ) -> None:
        """
        Updates this group's settings. Passing `None` will default this setting to the value already present in the

        Arguments:
            is_approval_required: Whether approval is required via a join request before joining this group.
            is_builders_club_required: Whether users are required to have a Premium subscription to join this group.
            are_enemies_allowed: Whether this group can send and recieve enemy requests.
            are_group_funds_visible: Whether the group fund balance is visible to external users.
            are_group_games_visible: Whether group games are visible to external users.
        """
        await self._client.requests.patch(
            url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/settings"),
            json={
                "isApprovalRequired": is_approval_required,
                "isBuildersClubRequired": is_builders_club_required,
                "areEnemiesAllowed": are_enemies_allowed,
                "areGroupFundsVisible": are_group_funds_visible,
                "areGroupGamesVisible": are_group_games_visible,
            }
        )

    def get_members(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,
                    max_items: int = None) -> PageIterator:
        """
        Gets all members of a group.

        Arguments:
            page_size: How many members should be returned for each page.
            sort_order: Order in which data should be grabbed.
            max_items: The maximum items to return when looping through this object.

        Returns:
            A PageIterator containing the group's members.
        """
        return PageIterator(
            client=self._client,
            url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/users"),
            page_size=page_size,
            sort_order=sort_order,
            max_items=max_items,
            handler=lambda client, data: Member(client=client, data=data, group=self)
        )

    def get_member(self, user: Union[int, BaseUser]) -> MemberRelationship:
        """
        Gets a member of a group.

        Arguments:
            user: A BaseUser or a User ID.

        Returns:
            A member.
        """
        return MemberRelationship(
            client=self._client,
            user=user,
            group=self
        )

    async def get_member_by_username(self, username: str, exclude_banned_users: bool = False) -> MemberRelationship:
        """
        Gets a member of a group by username.

        Arguments:
            username: A Roblox username.
            exclude_banned_users: Whether to exclude banned users from the data.

        Returns:
            A member.
        """

        user: RequestedUsernamePartialUser = await self._client.get_user_by_username(
            username=username,
            exclude_banned_users=exclude_banned_users,
            expand=False
        )

        return MemberRelationship(
            client=self._client,
            user=user,
            group=self
        )

    async def get_roles(self) -> List[Role]:
        """
        Gets all roles of the group.

        Returns:
            A list of the group's roles.
        """
        roles_response = await self._client.requests.get(
            url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/roles")
        )
        roles_data = roles_response.json()
        return [Role(
            client=self._client,
            data=role_data,
            group=self
        ) for role_data in roles_data["roles"]]

    async def set_role(self, user: UserOrUserId, role: RoleOrRoleId) -> None:
        """
        Sets a users role.

        Arguments:
            user: The user who's rank will be changed.
            role: The new role.
        """
        await self._client.requests.patch(
            url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/users/{int(user)}"),
            json={
                "roleId": int(role)
            }
        )

    async def set_rank(self, user: UserOrUserId, rank: int) -> None:
        """
        Changes a member's role using a rank number.

        Arguments:
            user: The user who's rank will be changed.
            rank: The rank number to change to. (1-255)
        """
        roles = await self.get_roles()

        role = next((role for role in roles if role.rank == rank), None)
        if not role:
            raise InvalidRole(f"Role with rank number {rank} does not exist.")

        await self.set_role(int(user), role)

    async def kick_user(self, user: UserOrUserId):
        """
        Kicks a user from a group.

        Arguments:
            user: The user who will be kicked from the group.
        """
        await self._client.requests.delete(
            url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/users/{int(user)}")
        )

    async def delete_all_messages(self, user: UserOrUserId):
        """
        Deletes all messages from a user in a group.

        Arguments:
            user: The user who will have their messages deleted.
        """
        await self._client.requests.delete(
            url=self._client.url_generator.get_url("groups", f"/v1/groups/{self.id}/wall/users/{int(user)}/posts")
        )

    def get_wall_posts(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,
                       max_items: int = None) -> PageIterator:
        """
        Gets wall posts of a group.

        Arguments:
            page_size: How many posts should be returned for each page.
            sort_order: Order in which data should be grabbed.
            max_items: The maximum items to return when looping through this object.

        Returns: A PageIterator.
        """
        return PageIterator(
            client=self._client,
            url=self._client.url_generator.get_url("groups", f"v2/groups/{self.id}/wall/posts"),
            page_size=page_size,
            sort_order=sort_order,
            max_items=max_items,
            handler=lambda client, data: WallPost(client=client, data=data, group=self)
        )

    def get_wall_post(self, post_id: int) -> WallPostRelationship:
        """
        Gets a wall post from an ID.

        Arguments:
            post_id: A post ID.

        Returns:
            A basic wall post relationship.
        """
        return WallPostRelationship(
            client=self._client,
            post_id=post_id,
            group=self
        )

    def get_join_requests(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,
                          max_items: int = None) -> PageIterator:
        """
        Gets all of this group's join requests.

        Arguments:
            page_size: How many members should be returned for each page.
            sort_order: Order in which data should be grabbed.
            max_items: The maximum items to return when looping through this object.

        Returns:
            A PageIterator containing group join requests.
        """
        return PageIterator(
            client=self._client,
            url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/join-requests"),
            page_size=page_size,
            sort_order=sort_order,
            max_items=max_items,
            handler=lambda client, data: JoinRequest(client=client, data=data, group=self)
        )

    async def get_join_request(self, user: Union[int, BaseUser]) -> Optional[JoinRequest]:
        """
        Gets a specific user's join request to this group.

        Returns:
            The user's join request, or None if they have no active join request.
        """
        join_response = await self._client.requests.get(
            url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/join-requests/users/{int(user)}")
        )
        join_data = join_response.json()
        return join_data and JoinRequest(

            client=self._client,
            data=join_data,
            group=self
        ) or None

    async def accept_user(self, user: Union[int, BaseUser, JoinRequest]):
        """
        Accepts a user's request to join this group.

        Arguments:
            user: The user to accept into this group.
        """
        await self._client.requests.post(
            url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/join-requests/users/{int(user)}")
        )

    async def decline_user(self, user: Union[int, BaseUser, JoinRequest]):
        """
        Declines a user's request to join this group.

        Arguments:
            user: The user to decline from this group.
        """
        await self._client.requests.delete(
            url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/join-requests/users/{int(user)}")
        )

    async def update_shout(self, message: str) -> Optional[Shout]:
        """
        Updates the shout.

        Arguments:
            message: The new shout message.
        """
        shout_response = await self._client.requests.patch(
            url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/status"),
            json={
                "message": message
            }
        )
        shout_data = shout_response.json()

        new_shout: Optional[Shout] = shout_data and Shout(
            client=self._client,
            data=shout_data
        ) or None

        return new_shout

    async def get_social_links(self) -> List[SocialLink]:
        """
        Gets the group's social links.

        Returns:
            A list of the universe's social links.
        """

        links_response = await self._client.requests.get(
            url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/social-links")
        )
        links_data = links_response.json()["data"]
        return [SocialLink(client=self._client, data=link_data) for link_data in links_data]

    def get_name_history(
            self, 
            page_size: int = 10, 
            sort_order: SortOrder = SortOrder.Ascending, 
            max_items: int = None
    ) -> PageIterator:
        """
        Grabs the groups's name history.

        Arguments:
            page_size: How many members should be returned for each page.
            sort_order: Order in which data should be grabbed.
            max_items: The maximum items to return when looping through this object.

        Returns:
            A PageIterator containing the groups's name history.
        """
        return PageIterator(
            client=self._client,
            url=self._client.url_generator.get_url(
                "groups", f"v1/groups/{self.id}/name-history"
            ),
            page_size=page_size,
            sort_order=sort_order,
            max_items=max_items,
            handler=lambda client, data: GroupNameHistoryItem(client=client, data=data),
        )

__init__(client, group_id)

Parameters:

Name Type Description Default
client Client

The Client this object belongs to.

required
group_id int

The group's ID.

required
Source code in roblox/bases/basegroup.py
129
130
131
132
133
134
135
136
def __init__(self, client: Client, group_id: int):
    """
    Parameters:
        client: The Client this object belongs to.
        group_id: The group's ID.
    """
    self._client: Client = client
    self.id: int = group_id

accept_user(user) async

Accepts a user's request to join this group.

Parameters:

Name Type Description Default
user Union[int, BaseUser, JoinRequest]

The user to accept into this group.

required
Source code in roblox/bases/basegroup.py
392
393
394
395
396
397
398
399
400
401
async def accept_user(self, user: Union[int, BaseUser, JoinRequest]):
    """
    Accepts a user's request to join this group.

    Arguments:
        user: The user to accept into this group.
    """
    await self._client.requests.post(
        url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/join-requests/users/{int(user)}")
    )

decline_user(user) async

Declines a user's request to join this group.

Parameters:

Name Type Description Default
user Union[int, BaseUser, JoinRequest]

The user to decline from this group.

required
Source code in roblox/bases/basegroup.py
403
404
405
406
407
408
409
410
411
412
async def decline_user(self, user: Union[int, BaseUser, JoinRequest]):
    """
    Declines a user's request to join this group.

    Arguments:
        user: The user to decline from this group.
    """
    await self._client.requests.delete(
        url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/join-requests/users/{int(user)}")
    )

delete_all_messages(user) async

Deletes all messages from a user in a group.

Parameters:

Name Type Description Default
user UserOrUserId

The user who will have their messages deleted.

required
Source code in roblox/bases/basegroup.py
304
305
306
307
308
309
310
311
312
313
async def delete_all_messages(self, user: UserOrUserId):
    """
    Deletes all messages from a user in a group.

    Arguments:
        user: The user who will have their messages deleted.
    """
    await self._client.requests.delete(
        url=self._client.url_generator.get_url("groups", f"/v1/groups/{self.id}/wall/users/{int(user)}/posts")
    )

get_join_request(user) async

Gets a specific user's join request to this group.

Returns:

Type Description
Optional[JoinRequest]

The user's join request, or None if they have no active join request.

Source code in roblox/bases/basegroup.py
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
async def get_join_request(self, user: Union[int, BaseUser]) -> Optional[JoinRequest]:
    """
    Gets a specific user's join request to this group.

    Returns:
        The user's join request, or None if they have no active join request.
    """
    join_response = await self._client.requests.get(
        url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/join-requests/users/{int(user)}")
    )
    join_data = join_response.json()
    return join_data and JoinRequest(

        client=self._client,
        data=join_data,
        group=self
    ) or None

get_join_requests(page_size=10, sort_order=SortOrder.Ascending, max_items=None)

Gets all of this group's join requests.

Parameters:

Name Type Description Default
page_size int

How many members should be returned for each page.

10
sort_order SortOrder

Order in which data should be grabbed.

Ascending
max_items int

The maximum items to return when looping through this object.

None

Returns:

Type Description
PageIterator

A PageIterator containing group join requests.

Source code in roblox/bases/basegroup.py
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
def get_join_requests(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,
                      max_items: int = None) -> PageIterator:
    """
    Gets all of this group's join requests.

    Arguments:
        page_size: How many members should be returned for each page.
        sort_order: Order in which data should be grabbed.
        max_items: The maximum items to return when looping through this object.

    Returns:
        A PageIterator containing group join requests.
    """
    return PageIterator(
        client=self._client,
        url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/join-requests"),
        page_size=page_size,
        sort_order=sort_order,
        max_items=max_items,
        handler=lambda client, data: JoinRequest(client=client, data=data, group=self)
    )

get_member(user)

Gets a member of a group.

Parameters:

Name Type Description Default
user Union[int, BaseUser]

A BaseUser or a User ID.

required

Returns:

Type Description
MemberRelationship

A member.

Source code in roblox/bases/basegroup.py
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
def get_member(self, user: Union[int, BaseUser]) -> MemberRelationship:
    """
    Gets a member of a group.

    Arguments:
        user: A BaseUser or a User ID.

    Returns:
        A member.
    """
    return MemberRelationship(
        client=self._client,
        user=user,
        group=self
    )

get_member_by_username(username, exclude_banned_users=False) async

Gets a member of a group by username.

Parameters:

Name Type Description Default
username str

A Roblox username.

required
exclude_banned_users bool

Whether to exclude banned users from the data.

False

Returns:

Type Description
MemberRelationship

A member.

Source code in roblox/bases/basegroup.py
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
async def get_member_by_username(self, username: str, exclude_banned_users: bool = False) -> MemberRelationship:
    """
    Gets a member of a group by username.

    Arguments:
        username: A Roblox username.
        exclude_banned_users: Whether to exclude banned users from the data.

    Returns:
        A member.
    """

    user: RequestedUsernamePartialUser = await self._client.get_user_by_username(
        username=username,
        exclude_banned_users=exclude_banned_users,
        expand=False
    )

    return MemberRelationship(
        client=self._client,
        user=user,
        group=self
    )

get_members(page_size=10, sort_order=SortOrder.Ascending, max_items=None)

Gets all members of a group.

Parameters:

Name Type Description Default
page_size int

How many members should be returned for each page.

10
sort_order SortOrder

Order in which data should be grabbed.

Ascending
max_items int

The maximum items to return when looping through this object.

None

Returns:

Type Description
PageIterator

A PageIterator containing the group's members.

Source code in roblox/bases/basegroup.py
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
def get_members(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,
                max_items: int = None) -> PageIterator:
    """
    Gets all members of a group.

    Arguments:
        page_size: How many members should be returned for each page.
        sort_order: Order in which data should be grabbed.
        max_items: The maximum items to return when looping through this object.

    Returns:
        A PageIterator containing the group's members.
    """
    return PageIterator(
        client=self._client,
        url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/users"),
        page_size=page_size,
        sort_order=sort_order,
        max_items=max_items,
        handler=lambda client, data: Member(client=client, data=data, group=self)
    )

get_name_history(page_size=10, sort_order=SortOrder.Ascending, max_items=None)

Grabs the groups's name history.

Parameters:

Name Type Description Default
page_size int

How many members should be returned for each page.

10
sort_order SortOrder

Order in which data should be grabbed.

Ascending
max_items int

The maximum items to return when looping through this object.

None

Returns:

Type Description
PageIterator

A PageIterator containing the groups's name history.

Source code in roblox/bases/basegroup.py
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
def get_name_history(
        self, 
        page_size: int = 10, 
        sort_order: SortOrder = SortOrder.Ascending, 
        max_items: int = None
) -> PageIterator:
    """
    Grabs the groups's name history.

    Arguments:
        page_size: How many members should be returned for each page.
        sort_order: Order in which data should be grabbed.
        max_items: The maximum items to return when looping through this object.

    Returns:
        A PageIterator containing the groups's name history.
    """
    return PageIterator(
        client=self._client,
        url=self._client.url_generator.get_url(
            "groups", f"v1/groups/{self.id}/name-history"
        ),
        page_size=page_size,
        sort_order=sort_order,
        max_items=max_items,
        handler=lambda client, data: GroupNameHistoryItem(client=client, data=data),
    )

get_roles() async

Gets all roles of the group.

Returns:

Type Description
List[Role]

A list of the group's roles.

Source code in roblox/bases/basegroup.py
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
async def get_roles(self) -> List[Role]:
    """
    Gets all roles of the group.

    Returns:
        A list of the group's roles.
    """
    roles_response = await self._client.requests.get(
        url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/roles")
    )
    roles_data = roles_response.json()
    return [Role(
        client=self._client,
        data=role_data,
        group=self
    ) for role_data in roles_data["roles"]]

get_settings() async

Gets all the settings of the selected group

Returns:

Type Description
GroupSettings

The group's settings.

Source code in roblox/bases/basegroup.py
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
async def get_settings(self) -> GroupSettings:
    """
    Gets all the settings of the selected group

    Returns:
        The group's settings.
    """
    settings_response = await self._client.requests.get(
        url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/settings"),
    )
    settings_data = settings_response.json()
    return GroupSettings(
        client=self._client,
        data=settings_data
    )

Gets the group's social links.

Returns:

Type Description
List[SocialLink]

A list of the universe's social links.

Source code in roblox/bases/basegroup.py
436
437
438
439
440
441
442
443
444
445
446
447
448
async def get_social_links(self) -> List[SocialLink]:
    """
    Gets the group's social links.

    Returns:
        A list of the universe's social links.
    """

    links_response = await self._client.requests.get(
        url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/social-links")
    )
    links_data = links_response.json()["data"]
    return [SocialLink(client=self._client, data=link_data) for link_data in links_data]

get_wall_post(post_id)

Gets a wall post from an ID.

Parameters:

Name Type Description Default
post_id int

A post ID.

required

Returns:

Type Description
WallPostRelationship

A basic wall post relationship.

Source code in roblox/bases/basegroup.py
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
def get_wall_post(self, post_id: int) -> WallPostRelationship:
    """
    Gets a wall post from an ID.

    Arguments:
        post_id: A post ID.

    Returns:
        A basic wall post relationship.
    """
    return WallPostRelationship(
        client=self._client,
        post_id=post_id,
        group=self
    )

get_wall_posts(page_size=10, sort_order=SortOrder.Ascending, max_items=None)

Gets wall posts of a group.

Parameters:

Name Type Description Default
page_size int

How many posts should be returned for each page.

10
sort_order SortOrder

Order in which data should be grabbed.

Ascending
max_items int

The maximum items to return when looping through this object.

None
Source code in roblox/bases/basegroup.py
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
def get_wall_posts(self, page_size: int = 10, sort_order: SortOrder = SortOrder.Ascending,
                   max_items: int = None) -> PageIterator:
    """
    Gets wall posts of a group.

    Arguments:
        page_size: How many posts should be returned for each page.
        sort_order: Order in which data should be grabbed.
        max_items: The maximum items to return when looping through this object.

    Returns: A PageIterator.
    """
    return PageIterator(
        client=self._client,
        url=self._client.url_generator.get_url("groups", f"v2/groups/{self.id}/wall/posts"),
        page_size=page_size,
        sort_order=sort_order,
        max_items=max_items,
        handler=lambda client, data: WallPost(client=client, data=data, group=self)
    )

kick_user(user) async

Kicks a user from a group.

Parameters:

Name Type Description Default
user UserOrUserId

The user who will be kicked from the group.

required
Source code in roblox/bases/basegroup.py
293
294
295
296
297
298
299
300
301
302
async def kick_user(self, user: UserOrUserId):
    """
    Kicks a user from a group.

    Arguments:
        user: The user who will be kicked from the group.
    """
    await self._client.requests.delete(
        url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/users/{int(user)}")
    )

set_rank(user, rank) async

Changes a member's role using a rank number.

Parameters:

Name Type Description Default
user UserOrUserId

The user who's rank will be changed.

required
rank int

The rank number to change to. (1-255)

required
Source code in roblox/bases/basegroup.py
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
async def set_rank(self, user: UserOrUserId, rank: int) -> None:
    """
    Changes a member's role using a rank number.

    Arguments:
        user: The user who's rank will be changed.
        rank: The rank number to change to. (1-255)
    """
    roles = await self.get_roles()

    role = next((role for role in roles if role.rank == rank), None)
    if not role:
        raise InvalidRole(f"Role with rank number {rank} does not exist.")

    await self.set_role(int(user), role)

set_role(user, role) async

Sets a users role.

Parameters:

Name Type Description Default
user UserOrUserId

The user who's rank will be changed.

required
role RoleOrRoleId

The new role.

required
Source code in roblox/bases/basegroup.py
262
263
264
265
266
267
268
269
270
271
272
273
274
275
async def set_role(self, user: UserOrUserId, role: RoleOrRoleId) -> None:
    """
    Sets a users role.

    Arguments:
        user: The user who's rank will be changed.
        role: The new role.
    """
    await self._client.requests.patch(
        url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/users/{int(user)}"),
        json={
            "roleId": int(role)
        }
    )

update_settings(is_approval_required=None, is_builders_club_required=None, are_enemies_allowed=None, are_group_funds_visible=None, are_group_games_visible=None) async

Updates this group's settings. Passing None will default this setting to the value already present in the

Parameters:

Name Type Description Default
is_approval_required Optional[bool]

Whether approval is required via a join request before joining this group.

None
is_builders_club_required Optional[bool]

Whether users are required to have a Premium subscription to join this group.

None
are_enemies_allowed Optional[bool]

Whether this group can send and recieve enemy requests.

None
are_group_funds_visible Optional[bool]

Whether the group fund balance is visible to external users.

None
are_group_games_visible Optional[bool]

Whether group games are visible to external users.

None
Source code in roblox/bases/basegroup.py
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
async def update_settings(
        self,
        is_approval_required: Optional[bool] = None,
        is_builders_club_required: Optional[bool] = None,
        are_enemies_allowed: Optional[bool] = None,
        are_group_funds_visible: Optional[bool] = None,
        are_group_games_visible: Optional[bool] = None,
) -> None:
    """
    Updates this group's settings. Passing `None` will default this setting to the value already present in the

    Arguments:
        is_approval_required: Whether approval is required via a join request before joining this group.
        is_builders_club_required: Whether users are required to have a Premium subscription to join this group.
        are_enemies_allowed: Whether this group can send and recieve enemy requests.
        are_group_funds_visible: Whether the group fund balance is visible to external users.
        are_group_games_visible: Whether group games are visible to external users.
    """
    await self._client.requests.patch(
        url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/settings"),
        json={
            "isApprovalRequired": is_approval_required,
            "isBuildersClubRequired": is_builders_club_required,
            "areEnemiesAllowed": are_enemies_allowed,
            "areGroupFundsVisible": are_group_funds_visible,
            "areGroupGamesVisible": are_group_games_visible,
        }
    )

update_shout(message) async

Updates the shout.

Parameters:

Name Type Description Default
message str

The new shout message.

required
Source code in roblox/bases/basegroup.py
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
async def update_shout(self, message: str) -> Optional[Shout]:
    """
    Updates the shout.

    Arguments:
        message: The new shout message.
    """
    shout_response = await self._client.requests.patch(
        url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/status"),
        json={
            "message": message
        }
    )
    shout_data = shout_response.json()

    new_shout: Optional[Shout] = shout_data and Shout(
        client=self._client,
        data=shout_data
    ) or None

    return new_shout

GroupNameHistoryItem

Represents a group's previous name.

Attributes:

Name Type Description
name str

The group's previous name.

created datetime

A datetime object representing when this name was changed.

Source code in roblox/bases/basegroup.py
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
class GroupNameHistoryItem:
    """
    Represents a group's previous name.

    Attributes:
        name: The group's previous name.
        created: A datetime object representing when this name was changed.
    """

    def __init__(self, client: Client, data: dict):
        """
        Arguments:
            client: The Client this object belongs to.
            data: The group's previous name data.
        """

        self._client: Client = client
        self.name: str = data["name"]
        self.created: datetime = parse(data["created"])

    def __repr__(self):
        return f"<{self.__class__.__name__} name={self.name!r} created={self.created}>"

__init__(client, data)

Parameters:

Name Type Description Default
client Client

The Client this object belongs to.

required
data dict

The group's previous name data.

required
Source code in roblox/bases/basegroup.py
106
107
108
109
110
111
112
113
114
115
def __init__(self, client: Client, data: dict):
    """
    Arguments:
        client: The Client this object belongs to.
        data: The group's previous name data.
    """

    self._client: Client = client
    self.name: str = data["name"]
    self.created: datetime = parse(data["created"])

GroupSettings

Represents a group's settings.

Attributes:

Name Type Description
is_approval_required bool

Whether approval is required to join this group.

is_builders_club_required bool

Whether a membership is required to join this group.

are_enemies_allowed bool

Whether group enemies are allowed.

are_group_funds_visible bool

Whether group funds are visible.

are_group_games_visible bool

Whether group games are visible.

is_group_name_change_enabled bool

Whether group name changes are enabled.

can_change_group_name bool

Whether the name of this group can be changed.

Source code in roblox/bases/basegroup.py
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
class GroupSettings:
    """
    Represents a group's settings.

    Attributes:
        is_approval_required: Whether approval is required to join this group.
        is_builders_club_required: Whether a membership is required to join this group.
        are_enemies_allowed: Whether group enemies are allowed.
        are_group_funds_visible: Whether group funds are visible.
        are_group_games_visible: Whether group games are visible.
        is_group_name_change_enabled: Whether group name changes are enabled.
        can_change_group_name: Whether the name of this group can be changed.
    """

    def __init__(self, client: Client, data: dict):
        """
        Arguments:
            client: The Client this object belongs to.
            data: The group settings data.
        """

        self._client: Client = client
        self.is_approval_required: bool = data["isApprovalRequired"]
        self.is_builders_club_required: bool = data["isBuildersClubRequired"]
        self.are_enemies_allowed: bool = data["areEnemiesAllowed"]
        self.are_group_funds_visible: bool = data["areGroupFundsVisible"]
        self.are_group_games_visible: bool = data["areGroupGamesVisible"]
        self.is_group_name_change_enabled: bool = data["isGroupNameChangeEnabled"]
        self.can_change_group_name: bool = data["canChangeGroupName"]

__init__(client, data)

Parameters:

Name Type Description Default
client Client

The Client this object belongs to.

required
data dict

The group settings data.

required
Source code in roblox/bases/basegroup.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
def __init__(self, client: Client, data: dict):
    """
    Arguments:
        client: The Client this object belongs to.
        data: The group settings data.
    """

    self._client: Client = client
    self.is_approval_required: bool = data["isApprovalRequired"]
    self.is_builders_club_required: bool = data["isBuildersClubRequired"]
    self.are_enemies_allowed: bool = data["areEnemiesAllowed"]
    self.are_group_funds_visible: bool = data["areGroupFundsVisible"]
    self.are_group_games_visible: bool = data["areGroupGamesVisible"]
    self.is_group_name_change_enabled: bool = data["isGroupNameChangeEnabled"]
    self.can_change_group_name: bool = data["canChangeGroupName"]

JoinRequest

Represents a group join request.

Attributes:

Name Type Description
created datetime

When this join request was sent.

requester PartialUser

The user that sent the join request.

group BaseGroup

The parent group that this join request is linked to.

Source code in roblox/bases/basegroup.py
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
class JoinRequest:
    """
    Represents a group join request.

    Attributes:
        created: When this join request was sent.
        requester: The user that sent the join request.
        group: The parent group that this join request is linked to.
    """

    def __init__(self, client: Client, data: dict, group: Union[BaseGroup, int]):
        self._client: Client = client
        self.created: datetime = parse(data["created"])
        self.requester: PartialUser = PartialUser(client=self._client, data=data["requester"])
        self.group: BaseGroup
        if isinstance(group, int):
            self.group = BaseGroup(client=self._client, group_id=group)
        else:
            self.group = group

    def __int__(self):
        return self.requester.id

    async def accept(self):
        """
        Accepts this join request.
        """
        await self.group.accept_user(self)

    async def decline(self):
        """
        Declines this join request.
        """
        await self.group.decline_user(self)

accept() async

Accepts this join request.

Source code in roblox/bases/basegroup.py
53
54
55
56
57
async def accept(self):
    """
    Accepts this join request.
    """
    await self.group.accept_user(self)

decline() async

Declines this join request.

Source code in roblox/bases/basegroup.py
59
60
61
62
63
async def decline(self):
    """
    Declines this join request.
    """
    await self.group.decline_user(self)