Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

list object not callable #14

Closed
JimmyTheGreat1500 opened this issue Apr 26, 2022 · 16 comments
Closed

list object not callable #14

JimmyTheGreat1500 opened this issue Apr 26, 2022 · 16 comments

Comments

@JimmyTheGreat1500
Copy link

when i try to get the servers it says that,
File "main.py", line 8, in <module> servs = aternos.servers()[0] TypeError: 'list' object is not callable 

@JimmyTheGreat1500
Copy link
Author

now, seperately it is saying token_func = js_code[1] if len(js_code) > 1 else js_code[0]
IndexError: list index out of range

@DarkCat09
Copy link
Owner

Look at the Readme, you need to call list_servers() since v0.6.
IndexError means Aternos changed html-page code again. I'm going to fix this soon.
Thank you very much.

@DarkCat09 DarkCat09 added the update Aternos API or security methods were changed label Apr 27, 2022
@JimmyTheGreat1500
Copy link
Author

JimmyTheGreat1500 commented Apr 27, 2022 via email

@DarkCat09
Copy link
Owner

DarkCat09 commented Apr 27, 2022

Yes, I've removed the link to the wiki from Readme because I didn't update it.
Please, use the code from Examples and Readme until I create documentation.

@JimmyTheGreat1500
Copy link
Author

JimmyTheGreat1500 commented Apr 27, 2022 via email

@DarkCat09
Copy link
Owner

https://github.com/DarkCat09/python-aternos/blob/main/examples/start_example.py

aternos = Client.from_credentials(user, pswd)
srvs = aternos.list_servers()
print(srvs)
s = srvs[0]
s.start()

@JimmyTheGreat1500
Copy link
Author

JimmyTheGreat1500 commented Apr 27, 2022 via email

@DarkCat09
Copy link
Owner

What version do you use? Update python-aternos from pip:

pip install -U python-aternos

@DarkCat09
Copy link
Owner

I may have found an unlisted dependency: js2py

No, it's specified as a dependency in setup.py and requirements.txt.

@JimmyTheGreat1500
Copy link
Author

JimmyTheGreat1500 commented Apr 27, 2022 via email

@JimmyTheGreat1500
Copy link
Author

dang it might just be me but the error still is there... maybe i have an old version? trying to get this to work so i can make a discord bot and have a command to start my server... do i need to clone the repo or something? also if it helps im using the default pip on the default version of python on replit... id think thats the latest?

@JimmyTheGreat1500
Copy link
Author

Look at the Readme, you need to call list_servers() since v0.6. IndexError means Aternos changed html-page code again. I'm going to fix this soon. Thank you very much.

how soon is "soon"? i need the discord bot before i start my smp and if i dont people will be too annoying to start the server themselves so itll die

@JimmyTheGreat1500
Copy link
Author

also im gonna make the discord bot easily configurable so you can clone the repo and set up a config file so you type in the discord bot api key, and your aternos credentials, and then your good. would that be possible

@DarkCat09
Copy link
Owner

A small changes in Aternos website break all code... I hope I'll do something about it.
Please, wait a while, I'm going to release the fix tomorrow at about 10:30 GMT+4.

@DarkCat09
Copy link
Owner

Read this comment: #15 (comment)
Just try to login one more time. This is the bug, it'll be fixed as I said before.

@DarkCat09
Copy link
Owner

Update the module. If the error will appear again, host your bot on your PC or Heroku (it's free) instead of Replit.

@DarkCat09 DarkCat09 removed the update Aternos API or security methods were changed label May 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants