vic1707 / AutoPlay-PokeMeow-Discord

A bot that plays PokeMeow for you
15 stars 19 forks source link

No module named 'classes' #43

Closed AayushP123 closed 2 years ago

AayushP123 commented 2 years ago

I have no idea what is going on but for some reason when I run all the -U -M -P -C stuff, this is what happens. The x's have my personal info so I didn't put that in.

x-MacBook-Air ~ % python3 desktop/bot.py -U 'x' -M 'x' -P 'x' -C 'https://discord.com/channels/995258024824418305/1010642632550121584' Traceback (most recent call last): File "/Users/x/desktop/bot.py", line 6, in from Classes.Fishing import Fish ModuleNotFoundError: No module named 'Classes' %

vic1707 commented 2 years ago

Did you download all the files ?

AayushP123 commented 2 years ago

Ok so im pretty stupid but I figured it out, so now I don't know what to do here. Again, the x's are all my personal info. For some reason it keeps saying no attribute w3c or something. This is the last step I'm so close lol

x@x-MacBook-Air AutoPlay-PokeMeow-Discord-main % python3 bot.py -U 'x' -M 'x' -P 'x' -C 'x' -D 'Chrome'

It's 11:33:50, working time ! Traceback (most recent call last): File "/opt/homebrew/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 76, in init RemoteWebDriver.init( File "/opt/homebrew/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in init self.start_session(capabilities, browser_profile) File "/opt/homebrew/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/opt/homebrew/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/opt/homebrew/lib/python3.10/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 92 Current browser version is 104.0.5112.101 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/x/Downloads/AutoPlay-PokeMeow-Discord-main/bot.py", line 39, in DRIVER = CustomDriver(ARGUMENTS) File "/Users/x/Downloads/AutoPlay-PokeMeow-Discord-main/Classes/CustomDriver.py", line 54, in init webdriver.Chrome.init(self, executable_path=path_binary, chrome_options=options) File "/opt/homebrew/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 83, in init self.quit() File "/opt/homebrew/lib/python3.10/site-packages/selenium/webdriver/firefox/webdriver.py", line 208, in quit if self.w3c: AttributeError: 'CustomDriver' object has no attribute 'w3c'

Press Enter to close !!

vic1707 commented 2 years ago

There are already multiple issues with that same problem, most of the time you juste have to update the webdriver you use

AayushP123 commented 2 years ago

Alright ima go try that real quick I'll tell you if that works

AayushP123 commented 2 years ago

I have downloaded more than 1 chrome driver, and its still showing the same error, do I need to delete the other one?

AayushP123 commented 2 years ago

Can you give me a link to what to download and how to do it, because I literally can't do anything, I am trying everything that is possible, nothing is working.

vic1707 commented 2 years ago

https://github.com/mozilla/geckodriver/releases This one is for Firefox, you must chose a version compatible with the Firefox version installed on your system, and place it in place of the previous one (in the webdriver folder).

AayushP123 commented 2 years ago

I managed to fix it thanks to your help, but now I'm stuck with this, is this non fixable?

except TimeoutException: raise Exception(f'"{ item }" took too much time to apear, dev can\'t really do anything to fix it') Exception: "Discord sending bar" took too much time to apear, dev can't really do anything to fix it

vic1707 commented 2 years ago

It's always fixable, this message is here mainly because it can take time or is country specific.

I'm aware of this error, this is due to a value being outdated due to some discord updates.

To fix it you just have to find the correct value and place it in place of the current one line 30 in the CustomWebdriver.py file.

It's not fixed cause I don't have time nor will to maintain this bot anymore which is why the repo is archived.

A new bot was developed by @Mehul343 but it was apparently deleted. His bot was using discord.py-self which is a far superior to what I'm using.

AayushP123 commented 2 years ago

What exactly do I change? Do you mean the SEND_MSG_BAR_XPATH: str = "//div[@class='markup-eYLPri slateTextArea-27tjG0 fontSize16Padding-XoMpjI']"? If so, how do I change it and what do I change it to?

vic1707 commented 2 years ago

You're supposed to change the value of the variable : what's inside the "" which describes the exact location of the sending message bar. To find the new value you have to open the browser devtools and find the send message bar. Then extract it's XPATH and put the value in place of the current one. It can be really slow to find the exact value, plus you have to do it for this bar and for multiple other places such as embed fields. If you manage to fix this error, a new one will probably appear for those other places, the line 35 of that same file probably needs to be updated as well. Many lines in the Bag.py might also need an update if Pokemeow changed certain words or sentences in their messages. I have no idea of what the current value should be and won't be looking for it since I don't want to maintain this bot anymore

AayushP123 commented 2 years ago

Alright well thank you for the help, but I sadly do not see this working for me, thanks anyways though!