Skip to content

Commit

Permalink
Add update-user endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
acatiadroid committed Dec 23, 2023
1 parent b15b977 commit 26a22bd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion bloxlink/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,15 @@ async def lookup_discord_user(self, roblox_id: int, server_id: int = None) -> Di
*if you intend on doing a global search (which required approval), do not include this argument.
Otherwise, you must provide this argument."""
return await Request._get_discord_user(self._headers, roblox_id, server_id)
return await Request._get_discord_user(self._headers, roblox_id, server_id)

async def update_user(self, discord_id: int, server_id: int) -> dict:
"""Updates a Discord user in the specified server. This is equivalent to running /verify in a server.
Returns the roles which have been added/removed and the new nickname as a dict.
Attributes
----------
discord_id - the ID of the Discord user you want to update.
server_id - the ID of the server you want to update the user in."""
return await Request._update_discord_user(self._headers, discord_id, server_id)
2 changes: 1 addition & 1 deletion bloxlink/payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async def _get_discord_user(headers: dict, roblox_id: int, server_id: int = None
return DiscordUserReponse(resp)

async def _update_discord_user(headers: dict, discord_id: int, server_id: int):
resp = await _make_post_request(headers, UPDATE_DISCORD_USER_URL.format(discord_id, server_id))
resp = await _make_post_request(headers, UPDATE_DISCORD_USER_URL.format(server_id, discord_id))

return resp

0 comments on commit 26a22bd

Please sign in to comment.