mekolaos / aternos-on-discord Goto Github PK
View Code? Open in Web Editor NEWA Discord Bot to manage a minecraft server on Aternos.
License: GNU General Public License v3.0
A Discord Bot to manage a minecraft server on Aternos.
License: GNU General Public License v3.0
It responds to only 1 command that is --crash
This is what i see after running it
And this is what i see after using --crash
Some background info:-
The bot comes online ;
I have did everything the instructions said word for word;
I have double checked all the information ;
I was only asked to input The Bot Token, Aternos Username and Aternos Password ;
This was in the requirements.txt :-
aiohttp==3.6.2 async-timeout==3.0.1 attrs==19.3.0 bandit==1.6.2 certifi==2019.11.28 chardet==3.0.4 chromedriver-py==87.0.4280.88 discord==1.0.1 discord.py==1.5.1 gitdb==4.0.5 GitPython==3.1.7 idna==2.8 lxml==4.5.0 multidict==4.7.4 pbr==5.4.5 python-dotenv==0.11.0 PyYAML==5.3.1 requests==2.22.0 selenium==3.141.0 six==1.15.0 smmap==3.0.4 stevedore==3.2.0 urllib3==1.25.8 websockets==8.1 yarl==1.4.2
Please someone help me.
Ignoring exception in command launch:
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "Bot.py", line 70, in launch
await start_server()
File "/home/ubuntu/Aternos-On-Discord/connect_and_launch.py", line 36, in start_server
element.click()
File "/home/ubuntu/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webelement.py", line 80, in click
self._execute(Command.CLICK_ELEMENT)
File "/home/ubuntu/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "/home/ubuntu/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/ubuntu/.local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element <div id="start" class="btn btn-huge btn-success">...</div> is not clickable at point (388, 396). Other element would receive the click: <div class="sn-footer-tab">...</div>
(Session info: headless chrome=89.0.4389.72)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 902, in invoke
await ctx.command.invoke(ctx)
File "/home/ubuntu/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 864, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/ubuntu/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ElementClickInterceptedException: Message: element click intercepted: Element <div id="start" class="btn btn-huge btn-success">...</div> is not clickable at point (388, 396). Other element would receive the click: <div class="sn-footer-tab">...</div>
(Session info: headless chrome=89.0.4389.72)
Installed the bot on a RPi 4B 8Gb (with Ubuntu 20.04 LTS), worked since --launch
which throw the error above.
/usr/lib/python3/dist-packages/requests/init.py:89: RequestsDependencyWarning: urllib3 (1.26.4) or chardet (3.0.4) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Traceback (most recent call last):
File "Bot.py", line 10, in
from Configure import launch_config
File "/home/caston/Aternos-On-Discord/Configure.py", line 1, in
import tkinter as tk
ModuleNotFoundError: No module named 'tkinter'
I dont know how to fix please help
Hello, after nearly 8 hours of trying to install your aternos bot finnally it is alive i do have the bot on my server but when i try the command --launch server, the bot says
Launching Server...
An error occurred. Either the status server is not responding or you didn't set the server name correctly.
Trying to launch the server anyways.
But nothing is launching please help me.
Before this everything worked but when I go on ahead it gives me this error
DevTools listening on ws://127.0.0.1:52617/devtools/browser/82809784-b250-4f7d-940b-e7dec4574bea
Traceback (most recent call last):
File "D:\Downloads\Aternos-On-Discord-master\Aternos-On-Discord-master\Bot.py", line 11, in
from connect_and_launch import get_status, get_number_of_players,
File "D:\Downloads\Aternos-On-Discord-master\Aternos-On-Discord-master\connect_and_launch.py", line 28, in
driver = webdriver.Chrome(options=options, executable_path=binary_path)
File "C:\Users\Lenovo-PC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in init
RemoteWebDriver.init(
File "C:\Users\Lenovo-PC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init
self.start_session(capabilities, browser_profile)
File "C:\Users\Lenovo-PC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\Lenovo-PC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\Lenovo-PC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 88
Current browser version is 90.0.4430.93 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
Whenever i try to run any command besides --help and --players the console outputs the following error
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/l0nk/.local/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 902, in invoke
await ctx.command.invoke(ctx)
File "/home/l0nk/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 864, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/l0nk/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="nope"]/main/section/div[3]/div[3]/div[1]/div/span[2]/span"}
(Session info: chrome=90.0.4430.93)
i've seen in connect and launch.py that @id=nope is searched in a lot of functions, so i can't really tell which one is the one failing, or if they're all failing to locate nope.
Current prerequisites seem to be incomplete.
Does it need Chrome browser? If so, please include that
Can it work with any other browser? If so, please include that too.
Can it work with portable version of the said browsers?
I tried using Chromium, Ungoogled Chromium, Chrome and Vivaldi. First, since I never knew it required Chrome only (although chromedrvier-py does state that it is compatible with Chromium, so maybe chromium would be acceptable too). Second, it looks for the preinstalled location and there's no user option to change that, one has to edit the connect_and_launch.py file to include the location for portable or in case you installed in some different location.
I only tried it with the portable versions of Chromium, Ungoogles Chromium and Chrome (PAF)
It doesn't work. Nor do I know what is supposed to happen. The cmd window that pops up is always empty, the browser window opens up and everything is empty. I don't see the prompt to enter my bot token/aternos details in the command prompt at all. It just sits there idly.
Created the .env file via notepad with the required details as instructed, still cmd window is empty. It would be wise to show some log in case the cmd window needs to be open at all time for one. Second, at least open discord's page directly so people are not clueless about what is supposed to happen and that something is happening. Third, I am not sure but the discord bot is always offline too. Does it pop up to be online? If so, at least write that in so users know what is supposed to happen once you launch the script.
This is the error that pops up though:
This is the case with chromium and chrome as the chromedriver-py page states
Can not connect to the Service D:\AternosDB\Chrome\App\Chrome-bin\chrome.exe
In the case of Ungoogled Chromium, it just threw this instead
File "D:\AternosDB\connect_and_launch.py", line 28
driver = webdriver.Chrome(options=options, executable_path="D:\AternosDB\Ungoogled\chrome.exe")
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 18-19: truncated \UXXXXXXXX escape
Using python 3.9.5, created a virtual env, required modules installed correctly too. I also tried adding the chromedriver_win32.exe location and virtual env's script path in system env path but nothing pops up at all. Thinking that maybe it was not able to get the chromedriver's location.
Hey, I this is my installation console: pi@leon:~/Aternos-On-Discord $ pip install -r requirements.txt DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support Defaulting to user installation because normal site-packages is not writeable Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple ERROR: Could not find a version that satisfies the requirement aiohttp==3.6.2 (from -r requirements.txt (line 1)) (from versions: 0.1, 0.2, 0.3, 0.4, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.10.0, 0.10.1, 0.10.2, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.14.2, 0.14.3, 0.14.4, 0.15.0, 0.15.1, 0.15.2, 0.15.3, 0.16.0, 0.16.1, 0.16.2, 0.16.3, 0.16.4, 0.16.5, 0.16.6, 0.17.0, 0.17.1, 0.17.2, 0.17.3, 0.17.4, 0.18.0, 0.18.1, 0.18.2, 0.18.3, 0.18.4, 0.19.0, 0.20.0, 0.20.1, 0.20.2, 0.21.0, 0.21.1, 0.21.2, 0.21.4, 0.21.5, 0.21.6, 0.22.0a0, 0.22.0b0, 0.22.0b1, 0.22.0b2, 0.22.0b3, 0.22.0b4, 0.22.0b5, 0.22.0b6, 0.22.0, 0.22.1, 0.22.2, 0.22.3, 0.22.4, 0.22.5, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.5, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.2.0, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 2.0.0rc1, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6.post1, 2.0.7, 2.1.0, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.3.0a4, 2.3.0, 2.3.1, 2.3.2b2) ERROR: No matching distribution found for aiohttp==3.6.2 (from -r requirements.txt (line 1))
and if I `
pi@leon:~/Aternos-On-Discord $ python3 Bot.py
Traceback (most recent call last):
File "Bot.py", line 5, in
from connect_and_launch import start_server, get_status
File "/home/pi/Aternos-On-Discord/connect_and_launch.py", line 16, in
SERVER_STATUS_URI = "http://" + os.getenv("SERVER_STATUS_URI")
TypeError: can only concatenate str (not "NoneType") to str
`
Hi,
This bot doesn't work on the RPI 3B. Does this bot support ARM? Using Python3 and PIP3. Accessing RPI using SSH.
Hey, could you make a video on how to run this as I get multiple path errors when doing it myself.
Hello! I just started learning python and I do not understand anything here. I really want this bot on discord for my minecraft java server. Could someone please assist me via discord for this? Help is appreciated.
Thank you!
it just comes up with...
DevTools listening on ws://127.0.0.1:53641/devtools/browser/621da020-6112-47e1-b5e1-81c9e1fb4ce0
[WARNING] 2021-06-02 10:38:53,054 - PyNaCl is not installed, voice will NOT be supported
[INFO] 2021-06-02 10:38:53,062 - logging in using static token
[INFO] 2021-06-02 10:38:53,671 - Shard ID None has sent the IDENTIFY payload.
[INFO] 2021-06-02 10:38:53,841 - Shard ID None has connected to Gateway: ["gateway-prd-main-9884",{"micros":64544,"calls":["discord-sessions-blue-prd-2-171",{"micros":63436,"calls":["start_session",{"micros":31682,"calls":["api-prd-main-6516",{"micros":28408,"calls":["get_user",{"micros":2851},"add_authorized_ip",{"micros":1325},"get_guilds",{"micros":4152},"coros_wait",{"micros":1}]}]},"guilds_connect",{"micros":1,"calls":[]},"presence_connect",{"micros":31201,"calls":[]}]}]}] (Session ID: 82348bbe5791c5c8b3b28399c3f33126).
Ignoring exception in on_ready
Traceback (most recent call last):
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\FiercePC\Downloads\bot\Aternos-On-Discord-master\Bot.py", line 51, in on_ready
connect_account() # logs into aternos
File "C:\Users\FiercePC\Downloads\bot\Aternos-On-Discord-master\connect_and_launch.py", line 124, in connect_account
element = driver.find_element_by_css_selector('body > div > main > section'
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 598, in find_element_by_css_selector
return self.find_element(by=By.CSS_SELECTOR, value=css_selector)
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"body > div > main > section> div > div.servers.single > div > div.server-body"}
(Session info: headless chrome=90.0.4430.212)
Ignoring exception in command launch:
Traceback (most recent call last):
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(args, **kwargs)
File "C:\Users\FiercePC\Downloads\bot\Aternos-On-Discord-master\Bot.py", line 66, in launch
server_status = get_status()
File "C:\Users\FiercePC\Downloads\bot\Aternos-On-Discord-master\connect_and_launch.py", line 53, in get_status
return driver.find_element_by_xpath('//[@id="nope"]/main/section/div['
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="nope"]/main/section/div[3]/div[3]/div[1]/div/span[2]/span"}
(Session info: headless chrome=90.0.4430.212)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 902, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 864, in invoke
await injected(ctx.args, **ctx.kwargs)
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//[@id="nope"]/main/section/div[3]/div[3]/div[1]/div/span[2]/span"}
(Session info: headless chrome=90.0.4430.212)
Ignoring exception in command info:
Traceback (most recent call last):
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(args, **kwargs)
File "C:\Users\FiercePC\Downloads\bot\Aternos-On-Discord-master\Bot.py", line 121, in info
await ctx.send(embed=server_info_embed())
File "C:\Users\FiercePC\Downloads\bot\Aternos-On-Discord-master\embeds.py", line 7, in server_info_embed
ip, status, players, software, version, tps = get_server_info()
File "C:\Users\FiercePC\Downloads\bot\Aternos-On-Discord-master\connect_and_launch.py", line 106, in get_server_info
return get_ip(), get_status(), get_number_of_players(),
File "C:\Users\FiercePC\Downloads\bot\Aternos-On-Discord-master\connect_and_launch.py", line 75, in get_ip
return driver.find_element_by_xpath('//[@id="nope"]/main/section/div['
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="nope"]/main/section/div[3]/div[1]"}
(Session info: headless chrome=90.0.4430.212)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 902, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 864, in invoke
await injected(ctx.args, **ctx.kwargs)
File "C:\Users\FiercePC\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//[@id="nope"]/main/section/div[3]/div[1]"}
(Session info: headless chrome=90.0.4430.212)
when i launched the bot it logged in discord without a hitch but only --help was working. after changing the headless to False in connect_and_launch.py i was able to see that the login was returning a 403 error alert so the but the script was trying to find wasnt there yet. from what i understand the websites seems to understand that it is a bot. i have read some fixes and tried them out with no luck. is the dev does know any fixes please issue an update or let us know. thanks.
I am trying to setup the bot, but am having issues with step 3. I keep getting wrong path errors when i try to run the command
python.exe Bot.py
All I get out of the console is this
File "C:\Python38\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "C:\Python38\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Python38\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "Bot.py", line 7, in <module>
from connect_and_launch import start_server, get_status, stop_server
File "C:\Users\AdamParke\Downloads\Aternos-On-Discord-master(1)\Aternos-On-Discord-master\connect_and_launch.py", line 28, in <module>
driver = webdriver.Chrome(options=options)
File "C:\Python38\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
self.service.start()
File "C:\Python38\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
I need help on this. I got this error: selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 90
Current browser version is 92.0.4515.107 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
It happens everytime I run $ python3 Bot.py
I don't understand how to use this. Please help me, sorry
I'll detail my step by step process here.
cd C:\Users\lecal\Desktop\Aternos-On-Discord-master
pip install -r requirements.txt
python3 Bot.py
File "C:\Users\lecal\Desktop\Aternos-On-Discord-master\Bot.py", line 1, in <module>
import discord
ModuleNotFoundError: No module named 'discord'
I tried doing python -m venv venv source venv/bin/activate
, which would create two folders named venv and source then pip install -r requirements.txt
and I tried seperating the -m venv venv
and source venv/bin/activate
(Which just didn't work). I tried running the other files and only Configure.py worked, but even if I did put my info in it STILL would not find the module! I don't have any idea at this point...
PLEASE give me a solution or make a video for the poor souls who just have a small brain! We'd love to use this bot.
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2032.0_x64__qbz5n2kfra8p0\lib\tkinter_init_.py", line 1895, in call
return self.func(*args)
File "C:\Users\Manimation\Desktop\Aternos-On-Discord-master\Configure.py", line 36, in
save_button['command'] = lambda: save_configuration(bot_token_entry,
File "C:\Users\Manimation\Desktop\Aternos-On-Discord-master\Configure.py", line 50, in save_configuration
with open(".env", "w") as f:
PermissionError: [Errno 13] Permission denied: '.env'
When I try to run "pip install -r requirements.txt" it comes up with and error message saying "ERROR: Could not build wheels for multidict which use PEP 517 and cannot be installed directly". I have installed PEP517 and it says i have but this error keeps coming up. Any help would be greatly apprecciated
DevTools listening on ws://127.0.0.1:53661/devtools/browser/7ef92895-74fe-4a06-87df-d2ff2b8010df
Traceback (most recent call last):
File "C:\Users\daxil\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\http.py", line 256, in static_login
data = await self.request(Route('GET', '/users/@me'))
File "C:\Users\daxil\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\http.py", line 220, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File ".\Bot.py", line 57, in
client.run('UsNHd5JEiiOTM54fMK889KtsqYCE4JJF')
File "C:\Users\daxil\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 640, in run
return future.result()
File "C:\Users\daxil\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 621, in runner
await self.start(*args, **kwargs)
File "C:\Users\daxil\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 584, in start
await self.login(*args, bot=bot)
File "C:\Users\daxil\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 442, in login
await self.http.static_login(token.strip(), bot=bot)
File "C:\Users\daxil\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\http.py", line 260, in static_login
raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000022B7BE84430>
Traceback (most recent call last):
File "C:\Users\daxil\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 116, in del
self.close()
File "C:\Users\daxil\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
File "C:\Users\daxil\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 719, in call_soon
self._check_closed()
File "C:\Users\daxil\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
sys:1: RuntimeWarning: coroutine 'can_fire_async' was never awaited
So I changed headless to false, and got the chrome window. It had the 403 error but I cleared it and now it cant get past the login page because an error keeps popping up while the login button has already been clicked because it keeps showing the loading icon.
i dont really wanna run this 24/7 on my pc as
so i cant make a ".env" file on repl.it anymore as they have added a feature called "secrets" or environmental variables
and the thing just doesnt work...
can somebody help?
After going through the steps, I got the bot up and running. I run python3 Bot.py
and the bot is online. Everything works fine, except for a few commands. the only commands that work are --help
and --players
. This is probably because I have 3 servers (2 of which I have shared access to start and stop the server only). How do I specify which server the bot has to use, or does the bot only use the server that I own?
Also in case you need it, here is the log of when i use python3 Bot.py
:
Python bot.py does work, but does nothing properly, manual opening of files has the same result...
I need help on how to fix this issue, is there any way to fix this error and have the bot to work properly?
i installed chromedriver version 89 and chrome beta 89 but the bot wont start and this error keep on popping up
C:\Users\HET BHUVA\OneDrive\Desktop\BOT MAKING\Aternos-On-Discord-master>python bot.py
DevTools listening on ws://127.0.0.1:60562/devtools/browser/053210ff-e277-4eba-b0da-e4f4e2d5375c
[0224/111105.006:ERROR:browser_gpu_channel_host_factory.cc(168)] Failed to launch GPU process.
Traceback (most recent call last):
File "C:\Users\HET BHUVA\OneDrive\Desktop\BOT MAKING\Aternos-On-Discord-master\bot.py", line 11, in
from connect_and_launch import get_status, get_number_of_players,
File "C:\Users\HET BHUVA\OneDrive\Desktop\BOT MAKING\Aternos-On-Discord-master\connect_and_launch.py", line 28, in
driver = webdriver.Chrome(options=options, executable_path=binary_path)
File "C:\Users\HET BHUVA\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in init
RemoteWebDriver.init(
File "C:\Users\HET BHUVA\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init
self.start_session(capabilities, browser_profile)
File "C:\Users\HET BHUVA\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\HET BHUVA\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\HET BHUVA\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 89
Current browser version is 88.0.4324.190 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
please help me
Can someone help me? I got this error: selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary. I already ran pip -r requriements.txt but this error happens when I try to run python3 bot.py
I've never used python, or any coding software, before and I don't understand how to execute a command, like pip install -r requirements.txt
. I understand the actual bot setup and everything else, just not the part that requires intelligence. I would really appreciate if someone could explain this part to me in a more detailed and simple way.
full error output:
DevTools listening on ws://[hidden]:50991/devtools/browser/181c3580-6d89-4398-ac3d-169a1df1010c
[WARNING] 2021-11-14 13:45:17,819 - PyNaCl is not installed, voice will NOT be supported
[INFO] 2021-11-14 13:45:19,476 - logging in using static token
[INFO] 2021-11-14 13:45:20,331 - Shard ID None has sent the IDENTIFY payload.
[INFO] 2021-11-14 13:45:20,638 - Shard ID None has connected to Gateway: ["gateway-prd-main-2g1w",{"micros":79026,"calls":["discord-sessions-blue-prd-2-113",{"micros":78127,"calls":["start_session",{"micros":29793,"calls":["api-prd-main-mrtx",{"micros":26098,"calls":["get_user",{"micros":2914},"add_authorized_ip",{"micros":1481},"get_guilds",{"micros":3319},"coros_wait",{"micros":1}]}]},"guilds_connect",{"micros":1,"calls":[]},"presence_connect",{"micros":47779,"calls":[]}]}]}] (Session ID: 660fa4c4af70e3e0ebeb02c78519477e).
Ignoring exception in on_ready
Traceback (most recent call last):
File "C:\Users\l.e.yu\AppData\Roaming\Python\Python39\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\l.e.yu\Desktop\Aternos-On-Discord-master\Bot.py", line 51, in on_ready
connect_account() # logs into aternos
File "C:\Users\l.e.yu\Desktop\Aternos-On-Discord-master\connect_and_launch.py", line 124, in connect_account
element = driver.find_element_by_css_selector('body > div > main > section'
File "C:\Users\l.e.yu\AppData\Roaming\Python\Python39\site-packages\selenium\webdriver\remote\webdriver.py", line 598, in find_element_by_css_selector
return self.find_element(by=By.CSS_SELECTOR, value=css_selector)
File "C:\Users\l.e.yu\AppData\Roaming\Python\Python39\site-packages\selenium\webdriver\remote\webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "C:\Users\l.e.yu\AppData\Roaming\Python\Python39\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\l.e.yu\AppData\Roaming\Python\Python39\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"body > div > main > section> div > div.servers.single > div > div.server-body"}
(Session info: headless chrome=95.0.4638.69)
I just made my discord bot and it's not active, how can I turn it on?
When i execute python3 Bot.py only the bot respond with --help ```
`import asyncio
import time
import os
import logging
from selenium import webdriver
from selenium.common.exceptions import ElementNotInteractableException,
NoSuchElementException
from dotenv import load_dotenv
from chromedriver_py import binary_path
load_dotenv()
USER = os.getenv('USERNAME_C')
PASSWORD = os.getenv('PASSWORD_C')
URL = "https://aternos.org/go/"
adblock = False # for those with network wide ad blockers
headless = True # if you want a headless window
options = webdriver.ChromeOptions()
if headless:
options.add_argument('--headless')
options.add_argument("user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/87.0.4280.88 Safari/537.36")
driver = webdriver.Chrome(options=options, executable_path=binary_path)
async def start_server():
""" Starts the server by clicking on the start button.
The try except part tries to find the confirmation button, and if it
doesn't, it continues to loop until the confirm button is clicked."""
element = driver.find_element_by_xpath("//[@id="start"]")
element.click()
await asyncio.sleep(3)
# hides the notification question
driver.execute_script('hideAlert();')
# server state span
while get_status() == "Waiting in queue":
# while in queue, check for the confirm button and try click it
await asyncio.sleep(3)
try:
element = driver.find_element_by_xpath('//[@id="confirm"]')
element.click()
except ElementNotInteractableException:
pass
def get_status():
""" Returns the status of the server as a string."""
return driver.find_element_by_xpath('//*[@id="nope"]/main/section/div['
'3]/div[3]/div[1]/div/span['
'2]/span').text
def get_number_of_players():
""" Returns the number of players as a string.
Works: When server is online--Returns 0 if offline"""
try:
return driver.find_element_by_xpath('//*[@id="nope"]/main/section'
'/div[3]/div[5]/div[2]/div['
'1]/div[1]/div[2]/div[2]').text
except NoSuchElementException:
# Can't be 0/20 because max isn't always the same,
# could maybe pull max players from options page
return '0'
def get_ip():
""" Returns the severs IP address.
Works: Always works"""
return driver.find_element_by_xpath('//*[@id="nope"]/main/section/div['
'3]/div[1]').text[:-8]
def get_software():
""" Returns the server software.
Works: Always works"""
return driver.find_element_by_xpath('//*[@id="software"]').text
def get_version():
""" Returns the server version.
Works: Always works"""
return driver.find_element_by_xpath('//*[@id="version"]').text
def get_tps():
""" Returns the server TPS
Works; When the server is online--Returns '0' if offline"""
try:
return driver.find_element_by_xpath('//*[@id="nope"]/main/section'
'/div[3]/div[5]/div[2]/div['
'1]/div[3]/div[2]/div[2]').text
except NoSuchElementException:
return '0'
def get_server_info():
""" Returns a string of information about the server
Returns: server_ip, server_status, number of players, software,
version"""
return get_ip(), get_status(), get_number_of_players(),
get_software(), get_version(), get_tps()
def connect_account():
""" Connects to the accounts through a headless chrome tab so we don't
have to do it every time we want to start or stop the server."""
driver.get(URL)
# login to aternos
element = driver.find_element_by_xpath('//[@id="user"]')
element.send_keys(USER)
element = driver.find_element_by_xpath('//[@id="password"]')
element.send_keys(PASSWORD)
element = driver.find_element_by_xpath('//*[@id="login"]')
element.click()
time.sleep(2)
time.sleep(1)
# selects server from server list
element = driver.find_element_by_css_selector('body > div > main > section'
'> div > div.servers.single '
'> div > div.server-body')
element.click()
# by passes the 3 second adblock
if adblock:
adblockBypass()
logging.info('Aternos Tab Loaded')
def adblockBypass():
time.sleep(1)
element = driver.find_element_by_xpath('//*[@id="sXMbkZHTzeemhBrPtXgBD'
'DwAboVOOFxHiMjcTsUwoIOJ"]/div/'
'div/div[3]/div[2]/div[3]/div'
'[1]')
element.click()
time.sleep(3)
logging.debug("Adblock Wall Bypassed")
async def stop_server():
""" Stops server from aternos panel."""
element = driver.find_element_by_xpath("//*[@id="stop"]")
element.click()
def quitBrowser():
""" Quits the browser driver cleanly."""
driver.quit()
def refreshBrowser():
driver.refresh()
`
WARNING] 2021-03-31 17:45:25,765 - PyNaCl is not installed, voice will NOT be supported
[INFO] 2021-03-31 17:45:25,765 - logging in using static token
[INFO] 2021-03-31 17:45:27,890 - Shard ID None has sent the IDENTIFY payload.
[INFO] 2021-03-31 17:45:28,438 - Shard ID None has connected to Gateway: ["gateway-prd-main-6gdc",{"micros":80164,"calls":["discord-sessions-prd-2-87",{"micros":78143,"calls":["start_session",{"micros":71250,"calls":["api-prd-main-xgws",{"micros":68542,"calls":["get_user",{"micros":13723},"add_authorized_ip",{"micros":1616},"get_guilds",{"micros":12000},"coros_wait",{"micros":1}]}]},"guilds_connect",{"micros":1,"calls":[]},"presence_connect",{"micros":6406,"calls":[]}]}]}] (Session ID: 55ea2ed99a51decf547a66ae7dd99d06).
[INFO] 2021-03-31 17:45:35,157 - Aternos Tab Loaded
[INFO] 2021-03-31 17:45:35,157 - The bot is logged in as: Penthouse Cat#4239
Unhandled exception in internal background task 'serverStatus'.
Traceback (most recent call last):
File "C:\Users\soft\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\tasks_init_.py", line 101, in _loop
await self.coro(args, **kwargs)
File "C:\Users\soft\PycharmProjects\Aternos-On-Discord\Bot.py", line 153, in serverStatus
server_status = get_status()
File "C:\Users\soft\PycharmProjects\Aternos-On-Discord\connect_and_launch.py", line 53, in get_status
return driver.find_element_by_xpath('//[@id="nope"]/main/section/div['
File "C:\Users\soft\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "C:\Users\soft\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "C:\Users\soft\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\soft\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="nope"]/main/section/div[3]/div[3]/div[1]/div/span[2]/span"}
(Session info: headless chrome=89.0.4389.114)
[INFO] 2021-03-31 17:45:40,835 - Refreshed browser
Hello guys . I am new here so pls explain the steps in detail anyone since i really need this bot. I tried running the command in python and command prompt but it shows syntax error. i am stuck at the first step if u would help i might soon reach the last. I have windows os system. thanks
I told the bot to get server status(I inputted everything correctly) and then it just said "Getting status" and hasn't done anything else. How long is it supposed to take to get status?
Edit: it timed out. here's the error:
Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event await coro(*args, **kwargs) File "Bot.py", line 38, in on_message status = get_status() File "/Users/amonwarner/Desktop/Aternos-On-Discord/connect_and_launch.py", line 58, in get_status driver.get(SERVER_STATUS_URI) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 333, in get self.execute(Command.GET, {'url': url}) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: net::ERR_CONNECTION_TIMED_OUT (Session info: headless chrome=86.0.4240.111)
the bot already run as ok, theres no problems when login.
the problem that the bot only response with --help
them other command wont work
i try to make headless=false
it already in a server page (no login again) but unable to start or check status
i already instal with pip install -r requirements.txt
i also already set up the info of the account (aternos account and bot discord token)
this is the log
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS D:\program files\Python\Aternos-On-Discord-master> python Bot.py
DevTools listening on ws://127.0.0.1:60427/devtools/browser/7c794f75-0c94-4c70-8798-f2bb29475397
[WARNING] 2021-04-02 10:23:20,376 - PyNaCl is not installed, voice will NOT be supported
[INFO] 2021-04-02 10:23:20,378 - logging in using static token
[INFO] 2021-04-02 10:23:25,070 - Shard ID None has sent the IDENTIFY payload.
[INFO] 2021-04-02 10:23:25,842 - Shard ID None has connected to Gateway: ["gateway-prd-main-p9r5",{"micros":83217,"calls":["discord-sessions-prd-2-47",{"micros":81825,"calls":["start_session",{"micros":50841,"calls":["api-prd-main-tc46",{"micros":44533,"calls":["get_user",{"micros":2374},"add_authorized_ip",{"micros":2128},"get_guilds",{"micros":10346},"coros_wait",{"micros":1}]}]},"guilds_connect",{"micros":1,"calls":[]},"presence_connect",{"micros":27370,"calls":[]}]}]}] (Session ID: 5bde6202c5c32c9a776c66409e82cc32).
[11572:6484:0402/102326.311:ERROR:device_event_log_impl.cc(214)] [10:23:26.311] USB: usb_device_handle_win.cc:1056 Failed to read descriptor from
node connection: A device attached to the system is not functioning. (0x1F)
[11572:6484:0402/102326.313:ERROR:device_event_log_impl.cc(214)] [10:23:26.313] USB: usb_device_handle_win.cc:1056 Failed to read descriptor from
node connection: A device attached to the system is not functioning. (0x1F)
[INFO] 2021-04-02 10:24:00,671 - Aternos Tab Loaded
[INFO] 2021-04-02 10:24:00,672 - The bot is logged in as: Gabuter's MC Bot#7042
[WARNING] 2021-04-02 10:24:23,132 - Shard ID None heartbeat blocked for more than 10 seconds.
Loop thread traceback (most recent call last):
File "Bot.py", line 183, in
bot.run(BOT_TOKEN)
File "D:\program files\Python\lib\site-packages\discord\client.py", line 708, in run
loop.run_forever()
File "D:\program files\Python\lib\asyncio\base_events.py", line 523, in run_forever
self._run_once()
File "D:\program files\Python\lib\asyncio\base_events.py", line 1758, in _run_once
handle._run()
File "D:\program files\Python\lib\asyncio\events.py", line 88, in _run
self._context.run(self._callback, *self.args)
File "D:\program files\Python\lib\site-packages\discord\ext\tasks_init.py", line 101, in _loop
await self.coro(args, **kwargs)
File "Bot.py", line 153, in serverStatus
server_status = get_status()
File "D:\program files\Python\Aternos-On-Discord-master\connect_and_launch.py", line 53, in get_status
return driver.find_element_by_xpath('//[@id="nope"]/main/section/div['
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 978, in find_element
'value': value})['value']
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 319, in execute
response = self.command_executor.execute(driver_command, params)
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 374, in execute
return self._request(command_info[0], url, body=data)
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 397, in _request
resp = self._conn.request(method, url, body=body, headers=headers)
File "D:\program files\Python\lib\site-packages\urllib3\request.py", line 79, in request
method, url, fields=fields, headers=headers, **urlopen_kw
File "D:\program files\Python\lib\site-packages\urllib3\request.py", line 170, in request_encode_body
return self.urlopen(method, url, **extra_kw)
File "D:\program files\Python\lib\site-packages\urllib3\poolmanager.py", line 375, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "D:\program files\Python\lib\site-packages\urllib3\connectionpool.py", line 706, in urlopen
chunked=chunked,
File "D:\program files\Python\lib\site-packages\urllib3\connectionpool.py", line 440, in _make_request
httplib_response = conn.getresponse()
File "D:\program files\Python\lib\http\client.py", line 1321, in getresponse
response.begin()
File "D:\program files\Python\lib\http\client.py", line 296, in begin
version, status, reason = self._read_status()
File "D:\program files\Python\lib\http\client.py", line 257, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "D:\program files\Python\lib\socket.py", line 589, in readinto
return self._sock.recv_into(b)
Unhandled exception in internal background task 'serverStatus'.
Traceback (most recent call last):
File "D:\program files\Python\lib\site-packages\discord\ext\tasks_init_.py", line 101, in _loop
await self.coro(args, **kwargs)
File "Bot.py", line 153, in serverStatus
server_status = get_status()
File "D:\program files\Python\Aternos-On-Discord-master\connect_and_launch.py", line 53, in get_status
return driver.find_element_by_xpath('//[@id="nope"]/main/section/div['
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 978, in find_element
'value': value})['value']
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="nope"]/main/section/div[3]/div[3]/div[1]/div/span[2]/span"}
(Session info: chrome=89.0.4389.114)
[INFO] 2021-04-02 10:24:32,886 - Refreshed browser
[INFO] 2021-04-02 10:24:32,888 - Timed out receiving packet. Attempting a reconnect.
[INFO] 2021-04-02 10:24:32,889 - Got a request to RESUME the websocket.
[INFO] 2021-04-02 10:24:37,171 - Shard ID None has sent the RESUME payload.
[INFO] 2021-04-02 10:24:38,113 - Shard ID None has successfully RESUMED session 5bde6202c5c32c9a776c66409e82cc32 under trace ["gateway-prd-main-nwmd",{"micros":1594,"calls":["discord-sessions-prd-2-47",{"micros":47}]}].
Ignoring exception in command status:
Traceback (most recent call last):
File "D:\program files\Python\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(args, **kwargs)
File "Bot.py", line 110, in status
await ctx.send(f"The server is {get_status()}")
File "D:\program files\Python\Aternos-On-Discord-master\connect_and_launch.py", line 53, in get_status
return driver.find_element_by_xpath('//[@id="nope"]/main/section/div['
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 978, in find_element
'value': value})['value']
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="nope"]/main/section/div[3]/div[3]/div[1]/div/span[2]/span"}
(Session info: chrome=89.0.4389.114)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\program files\Python\lib\site-packages\discord\ext\commands\bot.py", line 902, in invoke
await ctx.command.invoke(ctx)
File "D:\program files\Python\lib\site-packages\discord\ext\commands\core.py", line 864, in invoke
await injected(ctx.args, **ctx.kwargs)
File "D:\program files\Python\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//[@id="nope"]/main/section/div[3]/div[3]/div[1]/div/span[2]/span"}
(Session info: chrome=89.0.4389.114)
Ignoring exception in command launch:
Traceback (most recent call last):
File "D:\program files\Python\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(args, **kwargs)
File "Bot.py", line 66, in launch
server_status = get_status()
File "D:\program files\Python\Aternos-On-Discord-master\connect_and_launch.py", line 53, in get_status
return driver.find_element_by_xpath('//[@id="nope"]/main/section/div['
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 978, in find_element
'value': value})['value']
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="nope"]/main/section/div[3]/div[3]/div[1]/div/span[2]/span"}
(Session info: chrome=89.0.4389.114)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\program files\Python\lib\site-packages\discord\ext\commands\bot.py", line 902, in invoke
await ctx.command.invoke(ctx)
File "D:\program files\Python\lib\site-packages\discord\ext\commands\core.py", line 864, in invoke
await injected(ctx.args, **ctx.kwargs)
File "D:\program files\Python\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//[@id="nope"]/main/section/div[3]/div[3]/div[1]/div/span[2]/span"}
(Session info: chrome=89.0.4389.114)
Ignoring exception in command info:
Traceback (most recent call last):
File "D:\program files\Python\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(args, **kwargs)
File "Bot.py", line 121, in info
await ctx.send(embed=server_info_embed())
File "D:\program files\Python\Aternos-On-Discord-master\embeds.py", line 7, in server_info_embed
ip, status, players, software, version, tps = get_server_info()
File "D:\program files\Python\Aternos-On-Discord-master\connect_and_launch.py", line 106, in get_server_info
return get_ip(), get_status(), get_number_of_players(),
File "D:\program files\Python\Aternos-On-Discord-master\connect_and_launch.py", line 75, in get_ip
return driver.find_element_by_xpath('//[@id="nope"]/main/section/div['
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 978, in find_element
'value': value})['value']
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "D:\program files\Python\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="nope"]/main/section/div[3]/div[1]"}
(Session info: chrome=89.0.4389.114)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\program files\Python\lib\site-packages\discord\ext\commands\bot.py", line 902, in invoke
await ctx.command.invoke(ctx)
File "D:\program files\Python\lib\site-packages\discord\ext\commands\core.py", line 864, in invoke
await injected(ctx.args, **ctx.kwargs)
File "D:\program files\Python\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//[@id="nope"]/main/section/div[3]/div[1]"}
(Session info: chrome=89.0.4389.114)
can someone help me? im newbie to xpath and stuffs,any help is really appreciated.
I don't know if it's cause I'm using replit or what but, I tried running this with headless set to False and I would always get a captcha page when it visits the Aternos site. Maybe there's no way around this anymore? Just reporting my issue.
It gives this error when I start the bot and the bot's status is stuck on Logging in.
DevTools listening on ws://127.0.0.1:52958/devtools/browser/f6be6125-88f9-4bae-a7df-77e77ca186b3
[WARNING] 2021-05-12 14:05:56,657 - PyNaCl is not installed, voice will NOT be supported
[INFO] 2021-05-12 14:05:56,657 - logging in using static token
[INFO] 2021-05-12 14:05:57,548 - Shard ID None has sent the IDENTIFY payload.
[INFO] 2021-05-12 14:05:57,996 - Shard ID None has connected to Gateway: ["gateway-prd-main-mp6n",{"micros":55180,"calls":["discord-sessions-prd-2-145",{"micros":52545,"calls":["start_session",{"micros":36046,"calls":["api-prd-main-mzxc",{"micros":32801,"calls":["get_user",{"micros":3217},"add_authorized_ip",{"micros":1724},"get_guilds",{"micros":9536},"coros_wait",{"micros":1}]}]},"guilds_connect",{"micros":2,"calls":[]},"presence_connect",{"micros":1698,"calls":[]}]}]}] (Session ID: 697c0b8bfb9bfef3ad7e7b4ea2f20cf5).
Ignoring exception in on_ready
Traceback (most recent call last):
File "C:\Users\Lenovo-PC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "D:\Downloads\Aternos-On-Discord-master\Aternos-On-Discord-master\Bot.py", line 51, in on_ready
connect_account() # logs into aternos
File "D:\Downloads\Aternos-On-Discord-master\Aternos-On-Discord-master\connect_and_launch.py", line 124, in connect_account
element = driver.find_element_by_css_selector('body > div > main > section'
File "C:\Users\Lenovo-PC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\remote\webdriver.py", line 598, in find_element_by_css_selector
return self.find_element(by=By.CSS_SELECTOR, value=css_selector)
File "C:\Users\Lenovo-PC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\remote\webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "C:\Users\Lenovo-PC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\Lenovo-PC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"body > div > main > section> div > div.servers.single > div > div.server-body"}
(Session info: headless chrome=90.0.4430.212)
when i use "pip install -r requirements.txt" it says
pip : The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the s
pelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ CategoryInfo : ObjectNotFound: (pip:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Hi,
This bot doesn't work on Google Cloud VM. Does this bot run in a CLI environment? Using Python3 and PIP3. Accessing Google Cloud VM using SSH.
hi, none of my commands were working so i turned headless = false and it turns out the reason why it wasn't working is because its getting error 403 when its trying to login to aternos.org. i think this is a bot stopping thing? does anyone have a way to bypass the restriction?
i am getting error when running pip help
Note: I tried mostly "everything" but can't write any command on discord other than "--help"
I have the latest version of chrome, python from microsoft store, probably in the latest version of windows, using powershell on administrator
PS C:\Users\muham\Aternos-On-Discord-master> python bot.py
DevTools listening on ws://127.0.0.1:55400/devtools/browser/1ff3ee6c-86f8-4f4a-8bda-1c094ca92aa7
[WARNING] 2021-03-29 22:48:38,106 - PyNaCl is not installed, voice will NOT be supported
[INFO] 2021-03-29 22:48:38,107 - logging in using static token
[INFO] 2021-03-29 22:48:38,962 - Shard ID None has sent the IDENTIFY payload.
[INFO] 2021-03-29 22:48:39,299 - Shard ID None has connected to Gateway: ["gateway-prd-main-dj3z",{"micros":125169,"calls":["discord-sessions-prd-2-126",{"micros":122798,"calls":["start_session",{"micros":94693,"calls":["api-prd-main-nqlr",{"micros":91793,"calls":["get_user",{"micros":3193},"add_authorized_ip",{"micros":1745},"get_guilds",{"micros":21488},"coros_wait",{"micros":2}]}]},"guilds_connect",{"micros":2,"calls":[]},"presence_connect",{"micros":14858,"calls":[]}]}]}] (Session ID: 117541f2d203010e91064177ebd6fc8b).
Ignoring exception in on_ready
Traceback (most recent call last):
File "C:\Users\muham\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\muham\Aternos-On-Discord-master\bot.py", line 51, in on_ready
connect_account() # logs into aternos
File "C:\Users\muham\Aternos-On-Discord-master\connect_and_launch.py", line 124, in connect_account
element = driver.find_element_by_css_selector('body > div > main > section'
File "C:\Users\muham\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\remote\webdriver.py", line 598, in find_element_by_css_selector
return self.find_element(by=By.CSS_SELECTOR, value=css_selector)
File "C:\Users\muham\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\remote\webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "C:\Users\muham\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\muham\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"body > div > main > section> div > div.servers.single > div > div.server-body"}
(Session info: headless chrome=89.0.4389.90)
I did everything but the bot doesn't come online...... what should i do?
Stacktrace for Server Info
:
Ignoring exception in on_message
Traceback (most recent call last):
File "D:\My Document\Programming\Python\Aternos-On-Discord\.venv\lib\site-packages\discord\client.py", line 333, in _run_event
await coro(*args, **kwargs)
File "D:/My Document/Programming/Python/Aternos-On-Discord/Bot.py", line 83, in on_message
ip, status, players, software, version = get_server_info()
File "D:\My Document\Programming\Python\Aternos-On-Discord\connect_and_launch.py", line 77, in get_server_info
return server_ip, get_status(), get_number_of_players(), software, version
File "D:\My Document\Programming\Python\Aternos-On-Discord\connect_and_launch.py", line 64, in get_number_of_players
element = driver.find_element_by_xpath('//*[@id="players"]')
File "D:\My Document\Programming\Python\Aternos-On-Discord\.venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "D:\My Document\Programming\Python\Aternos-On-Discord\.venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 978, in find_element
'value': value})['value']
File "D:\My Document\Programming\Python\Aternos-On-Discord\.venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "D:\My Document\Programming\Python\Aternos-On-Discord\.venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="players"]"}
(Session info: headless chrome=88.0.4324.104)
Stacktrace for Server Launch:
await start_server()
File "D:\My Document\Programming\Python\Aternos-On-Discord\connect_and_launch.py", line 33, in start_server
element.click()
File "D:\My Document\Programming\Python\Aternos-On-Discord\.venv\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click
self._execute(Command.CLICK_ELEMENT)
File "D:\My Document\Programming\Python\Aternos-On-Discord\.venv\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "D:\My Document\Programming\Python\Aternos-On-Discord\.venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "D:\My Document\Programming\Python\Aternos-On-Discord\.venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element <div id="start" class="btn btn-huge btn-success">...</div> is not clickable at point (387, 396). Other element would receive the click: <div class="sn-footer-tab">...</div>
(Session info: headless chrome=88.0.4324.104)
Tested on Main branch, Python 3.7 - I suspect Aternos have changed something in their UI maybe?
Please update to work with Chrome 85.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.