This repository has been archived on 2024-07-30. You can view files and clone it, but cannot push or open issues or pull requests.
python-aternos/examples/info_example.py

28 lines
707 B
Python
Raw Permalink Normal View History

from getpass import getpass
from python_aternos import Client, atserver
user = input('Username: ')
pswd = getpass('Password: ')
atclient = Client()
aternos = atclient.account
atclient.login(user, pswd)
srvs = aternos.list_servers()
for srv in srvs:
print()
print('***', srv.servid, '***')
srv.fetch()
print(srv.domain)
print(srv.motd)
print('*** Status:', srv.status)
print('*** Full address:', srv.address)
print('*** Port:', srv.port)
print('*** Name:', srv.subdomain)
print('*** Minecraft:', srv.software, srv.version)
print('*** IsBedrock:', srv.edition == atserver.Edition.bedrock)
print('*** IsJava:', srv.edition == atserver.Edition.java)
print()