Skip to content

members

This module contains classes intended to parse and deal with data from Roblox group member endpoints.

Member

Bases: MemberRelationship

Represents a group member.

Attributes:

Name Type Description
id int

The member's ID.

name str

The member's name.

display_name str

The member's display name.

role PartialRole

The member's role.

group BaseGroup

The member's group.

has_verified_badge bool

If the member has a verified badge.

Source code in roblox/members.py
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 Member(MemberRelationship):
    """
    Represents a group member.

    Attributes:
        id: The member's ID.
        name: The member's name.
        display_name: The member's display name.
        role: The member's role.
        group: The member's group.
        has_verified_badge: If the member has a verified badge.
    """

    def __init__(self, client: Client, data: dict, group: BaseGroup):
        self._client: Client = client

        self.id: int = data["user"]["userId"]
        self.name: str = data["user"]["username"]
        self.display_name: str = data["user"]["displayName"]
        self.has_verified_badge: bool = data["user"]["hasVerifiedBadge"]

        super().__init__(client=self._client, user=self.id, group=group)

        self.role: PartialRole = PartialRole(client=self._client, data=data["role"])
        self.group: BaseGroup = group

MemberRelationship

Bases: BaseUser

Represents a relationship between a user and a group.

Attributes:

Name Type Description
group BaseGroup

The corresponding group.

Source code in roblox/members.py
20
21
22
23
24
25
26
27
28
29
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
64
65
66
67
class MemberRelationship(BaseUser):
    """
    Represents a relationship between a user and a group.

    Attributes:
        group: The corresponding group.
    """

    def __init__(self, client: Client, user: Union[BaseUser, int], group: Union[BaseGroup, int]):
        self._client: Client = client
        super().__init__(client=self._client, user_id=int(user))

        self.group: BaseGroup

        if isinstance(group, int):
            self.group = BaseGroup(client=self._client, group_id=group)
        else:
            self.group = group

    async def set_role(self, role: RoleOrRoleId):
        """
        Sets this member's role.

        Arguments:
            role: The new role this member should be assigned.
        """
        await self.group.set_role(self, role)

    async def set_rank(self, rank: int):
        """
        Sets this member's rank.

        Arguments:
            rank: The new rank this member should be assigned. Should be in the range of 0-255.
        """
        await self.group.set_rank(self, rank)

    async def kick(self):
        """
        Kicks this member from the group.
        """
        await self.group.kick_user(self)

    async def delete_all_messages(self):
        """
        Deletes all wall posts created by this member in the group.
        """
        await self.group.delete_all_messages(self)

delete_all_messages() async

Deletes all wall posts created by this member in the group.

Source code in roblox/members.py
63
64
65
66
67
async def delete_all_messages(self):
    """
    Deletes all wall posts created by this member in the group.
    """
    await self.group.delete_all_messages(self)

kick() async

Kicks this member from the group.

Source code in roblox/members.py
57
58
59
60
61
async def kick(self):
    """
    Kicks this member from the group.
    """
    await self.group.kick_user(self)

set_rank(rank) async

Sets this member's rank.

Parameters:

Name Type Description Default
rank int

The new rank this member should be assigned. Should be in the range of 0-255.

required
Source code in roblox/members.py
48
49
50
51
52
53
54
55
async def set_rank(self, rank: int):
    """
    Sets this member's rank.

    Arguments:
        rank: The new rank this member should be assigned. Should be in the range of 0-255.
    """
    await self.group.set_rank(self, rank)

set_role(role) async

Sets this member's role.

Parameters:

Name Type Description Default
role RoleOrRoleId

The new role this member should be assigned.

required
Source code in roblox/members.py
39
40
41
42
43
44
45
46
async def set_role(self, role: RoleOrRoleId):
    """
    Sets this member's role.

    Arguments:
        role: The new role this member should be assigned.
    """
    await self.group.set_role(self, role)