iamkubi / pydactyl

Python wrapper for the Pterodactyl Panel API
MIT License
67 stars 21 forks source link

Get created server id #52

Closed Teunwrmzijnallenamenalingebruik closed 1 year ago

Teunwrmzijnallenamenalingebruik commented 2 years ago

Describe the bug I would like to a function where if the code is: result = api.servers.create_server(info) that the id of the just created server would be set.

iamkubi commented 1 year ago

You can already do this.

>>> resp = app_api.servers.create_server(name='My test Paper Server', user_id=1, 
                                         nest_id=1,egg_id=3,memory_limit=1000,
                                         swap_limit=0,backup_limit=0,
                                         disk_limit=0,location_ids=[1])
>>> resp.json()['attributes']['identifier']
'9d074573'