Skip to content

Commit

Permalink
fix asyncronous issues with group.py
Browse files Browse the repository at this point in the history
  • Loading branch information
treeben77 committed Nov 26, 2024
1 parent a207ec0 commit edd9a22
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rblxopencloudasync/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def __init__(self, member, api_key, group=None) -> None:
def __repr__(self) -> str:
return f"<rblxopencloud.GroupMember id={self.id} group={self.group}>"

def fetch_role(self, skip_cache: bool = False) -> GroupRole:
async def fetch_role(self, skip_cache: bool = False) -> GroupRole:
"""
Fetches and returns the user's role info (rank, role name, etc). The \
roles are cached therefore it runs faster. Shortcut for \
Expand All @@ -199,9 +199,9 @@ def fetch_role(self, skip_cache: bool = False) -> GroupRole:
rank.
"""

return self.group.fetch_role(self.role_id, skip_cache=skip_cache)
return await self.group.fetch_role(self.role_id, skip_cache=skip_cache)

def update(self, role_id: int = None):
async def update(self, role_id: int = None):
"""
Updates the member with the requested information and updates the \
member object attributes.
Expand All @@ -216,7 +216,7 @@ def update(self, role_id: int = None):
The updated [`GroupMember`][rblxopencloud.GroupMember] object.
"""

member = self.group.update_member(self.id, role_id)
member = await self.group.update_member(self.id, role_id)

self.role_id: int = member.role_id
self.updated_at: datetime.datetime = member.updated_at
Expand Down Expand Up @@ -493,7 +493,7 @@ async def list_roles(
[`GroupRole`][rblxopencloud.GroupRole] for every role in the group.
"""

for entry in await iterate_request(
async for entry in iterate_request(
"GET",
f"/groups/{self.id}/roles",
authorization=self.__api_key,
Expand Down

0 comments on commit edd9a22

Please sign in to comment.