open-wa / wa-automate-python

💬 🤖 The most advanced Python whatsapp library for chatbots with advanced features. Be sure to ⭐ this repository for updates!
Other
349 stars 75 forks source link

message.reply_message() function not working #92

Open Shyguy99 opened 3 years ago

Shyguy99 commented 3 years ago

While using the reply_message() function ,it showing this error.Same with sendMessageWithMentions function

Error in function reply (javascript error: moi is not defined JavaScript stack: ReferenceError: moi is not defined at Object.window.. [as getNewMessageId] (eval at executeScript (:445:16), :3:207006) at Object.window.. [as reply] (eval at executeScript (:445:16), :3:200389) at async Object.window.. [as pyFunc] (eval at executeScript (:445:16), :3:340428) (Session info: headless chrome=95.0.4638.69)). Command: return WAPI.pyFunc(()=>WAPI.reply('918888817110-1623809113@g.us','hhs','true_918888817110-1623809113@g.us_F2E7178E4E10FE485063C066B67F47A2'), arguments[0])

theTrolleyProblem commented 3 years ago

Getting the same error using either of the following:

Exception is as follows:

raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.JavascriptException: Message: ReferenceError: moi is not defined
Stacktrace:
@https://web.whatsapp.com/:2:213410
@https://web.whatsapp.com/:2:206873
During handling of the above exception, another exception occurred:

openwa.wapi_js_wrapper.JsException: Error in function reply (ReferenceError: moi is not defined). Command: return WAPI.pyFunc(()=>WAPI.reply('63019323768287@g.us','logged','true_63019323768287@g.us_E1FF79D11274414F7E840FB04EC03ED5'), arguments[0])
mrodal commented 3 years ago

@smashah looks like the same issue that happened with WAPI.getMe() and you added the moi definition to the main patches.. its weird because getMe() still works, but reply fails with the same error 🤔

smashah commented 2 years ago

@mrodal @theTrolleyProblem @Shyguy99 please restart and try again

Shyguy99 commented 2 years ago

@smashah I tried again, surprisingly it worked once but after that, it gave the same error :(

mrodal commented 2 years ago

@Shyguy99 could you explain a little more about how to reproduce the error? Its working fine for me now

Shyguy99 commented 2 years ago

@mrodal Bro I don't know what's happening, after reading your comment I use a message.reply_message() dynamically from WhatsApp using some command it worked fine but then I change the code of bot replacing every driver.chat_send_message() to message.reply_message() and restart the bot. now it again causes that error. Now using the reply_message() function dynamically also gives the same error. :(( This same scenario happened yesterday also.

mrodal commented 2 years ago

I just pushed some changes, could you check again with the latest version?

UnpopularOpinion commented 2 years ago

I am currently experiencing this issue today, Have tried both driver.reply_message() and message.reply_message()

mrodal commented 2 years ago

@UnpopularOpinion this library is being deprecated, I suggest that you try using the new https://github.com/open-wa/wa-automate-socket-client-python