joaoricardo000 / whatsapp-bot-seed

A small python framework to create a whatsapp bot, with regex-callback message routing.
728 stars 244 forks source link

Where do I turn on and off the encryption? #45

Closed abdhan closed 8 years ago

abdhan commented 8 years ago

First of all thanks a lot for this framework. It is quite easy to understand.

However there is a bug I face when I am in a group with another bot(not mine). I try to invoke an event but this error comes up:

`Traceback (most recent call last): File "src\server.py", line 38, in start self.stack.loop(timeout=0.5, discrete=0.5) File "X:\Coding\PYTHON\whatapp\lib\site-packages\yowsup\stacks\yowstack.py", line 187, in loop asyncore.loop(_args, *_kwargs) File "c:\python35\Lib\asyncore.py", line 203, in loop poll_fun(timeout, map) File "c:\python35\Lib\asyncore.py", line 150, in poll read(obj) File "c:\python35\Lib\asyncore.py", line 87, in read obj.handle_error() File "c:\python35\Lib\asyncore.py", line 83, in read obj.handle_read_event() File "c:\python35\Lib\asyncore.py", line 423, in handle_read_event self.handle_read() File "X:\Coding\PYTHON\whatapp\lib\site-packages\yowsup\layers\network\layer.py", line 86, in handle_read self.receive(data) File "X:\Coding\PYTHON\whatapp\lib\site-packages\yowsup\layers\network\layer.py", line 94, in receive self.toUpper(data) File "X:\Coding\PYTHON\whatapp\lib\site-packages\yowsup\layersinit.py", line 59, in toUpper self.upper.receive(data) File "X:\Coding\PYTHON\whatapp\lib\site-packages\yowsup\layers\stanzaregulator\layer.py", line 28, in receive self.processReceived() File "X:\Coding\PYTHON\whatapp\lib\site-packages\yowsup\layers\stanzaregulator\layer.py", line 48, in processReceived self.toUpper(oneMessageData) File "X:\Coding\PYTHON\whatapp\lib\site-packages\yowsup\layers__init.py", line 59, in toUpper self.upper.receive(data) File "X:\Coding\PYTHON\whatapp\lib\site-packages\yowsup\layers\auth\layer_crypt.py", line 63, in receive self.toUpper(payload) File "X:\Coding\PYTHON\whatapp\lib\site-packages\yowsup\layers__init.py", line 59, in toUpper self.upper.receive(data) File "X:\Coding\PYTHON\whatapp\lib\site-packages\yowsup\layers\coder\layer.py", line 35, in receive self.toUpper(node) File "X:\Coding\PYTHON\whatapp\lib\site-packages\yowsup\layers__init.py", line 59, in toUpper self.upper.receive(data) File "X:\Coding\PYTHON\whatapp\lib\site-packages\yowsup\layers\logger\layer.py", line 14, in receive self.toUpper(data) File "X:\Coding\PYTHON\whatapp\lib\site-packages\yowsup\layers__init.py", line 59, in toUpper self.upper.receive(data) File "X:\Coding\PYTHON\whatapp\lib\site-packages\yowsup\layers\axolotl\layer.py", line 126, in receive self.toUpper(protocolTreeNode) File "X:\Coding\PYTHON\whatapp\lib\site-packages\yowsup\layers__init.py", line 59, in toUpper self.upper.receive(data) File "X:\Coding\PYTHON\whatapp\lib\site-packages\yowsup\layers__init.py", line 169, in receive s.receive(data) File "X:\Coding\PYTHON\whatapp\lib\site-packages\yowsup\layersinit.py", line 105, in receive recv(node) File "X:\Coding\PYTHON\whatapp\lib\site-packages\yowsup\layers\auth\layer_authentication.py", line 89, in handleStreamError raise AuthError("Unhandled stream:error node:\n%s" % node) yowsup.layers.auth.autherror.AuthError: Unhandled stream:error node: stream:error

/stream:error

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "src\server.py", line 53, in server.start() File "src\server.py", line 40, in start logging.exception("Authentication Error: %s" % e.message) AttributeError: 'AuthError' object has no attribute 'message' `

If this is indeed the problem of encryption, then where can it be switched on and off? Any help is appreciated.

ghost commented 8 years ago

Take a look to my Pull request #34

abdhan commented 8 years ago

Apologies for not searching for similar issues before hand. I made the necessary changes and voila the error is gone. Thank you very much. On the other hand are all messages on this framework encrypted by default?

ghost commented 8 years ago

Yup

abdhan commented 8 years ago

That's great Thanks!