Replies: 2 comments 3 replies
-
Solution: When creating a new Client you will need to save some sort of a map, e.g. # First we obtain the user UUID somewhere (e.g. from the database) and pass it into the function above.
async def set_traffic_limit(telegram_id: int, user_uuid: str) -> None:
client = await api.client.get_by_email(str(telegram_id)) # Getting the client from API.
client.id = user_uuid # Updating the client ID to correct UUID (e.g. from the database).
client.total_gb = gigabytes_to_bytes(10) # Just for reference, setting the traffic limit for a Client to 10 Gb.
await api.client.update(user_uuid, client) # Updating the client. |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can get it through get_inbounds() method, like that: inbounds = await get_inbounds()
inbound = inbounds[0]
id = inbound.settings.clients[0].id |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem: The 3x-ui API does not return the actual Client UUID, it's returning just numerical ID, while for updating a client you'll need to know its UUID.
Beta Was this translation helpful? Give feedback.
All reactions