wa-automate-python icon indicating copy to clipboard operation
wa-automate-python copied to clipboard

message.reply_message() function not working

Open Shyguy99 opened this issue 2 years ago • 9 comments

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('[email protected]','hhs','[email protected]_F2E7178E4E10FE485063C066B67F47A2'), arguments[0])

Shyguy99 avatar Nov 19 '21 16:11 Shyguy99

Getting the same error using either of the following:

  • driver.reply_message
  • message.reply_message

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('[email protected]','logged','[email protected]_E1FF79D11274414F7E840FB04EC03ED5'), arguments[0])

theTrolleyProblem avatar Nov 23 '21 08:11 theTrolleyProblem

@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 🤔

mrodal avatar Nov 24 '21 13:11 mrodal

@mrodal @theTrolleyProblem @Shyguy99 please restart and try again

smashah avatar Nov 24 '21 22:11 smashah

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

Shyguy99 avatar Nov 27 '21 03:11 Shyguy99

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

mrodal avatar Nov 27 '21 11:11 mrodal

@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.

Shyguy99 avatar Nov 27 '21 15:11 Shyguy99

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

mrodal avatar Nov 27 '21 16:11 mrodal

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

UnpopularOpinion avatar Jun 08 '22 16:06 UnpopularOpinion

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

mrodal avatar Jun 08 '22 16:06 mrodal