error in using subscribe method

bhavyanarang2015
self.ws.sendMessage(

AttributeError: 'NoneType' object has no attribute 'sendMessage'
  • SRIJAN
    This is not sufficient. Paste the complete stacktrace.
  • bhavyanarang2015
    I have been using kws.subscribe outside on connect also because I want to dynamically add more tickers into the list and subscribe them. Cant we use subscribe outside on_connect?? if we can use then why im getting this error, and if not then how should I dynamically add tokens in the list because on connect will be called only once in a thread, they how shoukd I add tickers into the list???
  • SRIJAN
    SRIJAN edited March 2022
    Only for the first connection,you have to subscribe something first in on_connect. After that,you can use subscribe/unsubscribe outside on_connect. The error you are getting is due to using threaded ticker without properly assigning the callbacks.
Sign In or Register to comment.