open-wa / wa-automate-python

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

Cannot read property 'then' of undefined - Error in function sendMessage #96

Open fire17 opened 2 years ago

fire17 commented 2 years ago

cannot send messages it didnt work for awhile then it did then stopped again Traceback (most recent call last):


wa.chat_send_message(str(number), msg)
  File "openwaRepoGH/src/__init__.py", line 694, in chat_send_message
    result = self.wapi_functions.sendMessage(chat_id, message)
  File "openwaRepoGH/src/wapi_js_wrapper.py", line 182, in __call__
    "Error in function {0} ({1}). Command: {2}".format(self.function_name, e.msg, command))
openwaRepoGH.src.wapi_js_wrapper.JsException: Error in function sendMessage (javascript error: Cannot read property 'then' of undefined
JavaScript stack:
TypeError: Cannot read property 'then' of undefined
    at Object.window.WAPI.sendMessage (eval at executeScript (:480:16), <anonymous>:813:51)
    at eval (eval at executeAsyncScript (:556:26), <anonymous>:3:54)
    at Object.window.WAPI.pyFunc (eval at executeScript (:480:16), <anonymous>:2154:23)
    at eval (eval at executeAsyncScript (:556:26), <anonymous>:3:38)
    at eval (eval at executeAsyncScript (:556:26), <anonymous>:3:113)
    at executeAsyncScript (<anonymous>:556:47)
    at <anonymous>:571:29
    at callFunction (<anonymous>:450:22)
    at <anonymous>:464:23
    at <anonymous>:465:3
  (Session info: headless chrome=89.0.4389.72)). Command: return WAPI.pyFunc(()=>WAPI.sendMessage('XXXXXXXXXX@c.us','yooooo'), arguments[0])

the main error seems to be wapi_js_wrapper.JsException: Error in function sendMessage (javascript error: Cannot read property 'then' of undefined please help :pray:

fire17 commented 2 years ago

still getting this error is there a way to reload the driver properly ? or any other suggestions ? thank you

karen-pal commented 2 years ago

Hello,

I'm pretty sure this project has been abandoned, at least somewhat.

What I did was to use the mantained nodejs library: wa-automate-nodejs. Lately I've been using that and works great.

Cheers.