Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
:Raises:
SlackNotConnected if self.server is not defined.
'''
# in the future, this should handle some events internally i.e. channel
# creation
if self.server:
json_data = self.server.websocket_safe_read()
data = []
if json_data != '':
for d in json_data.split('\n'):
data.append(json.loads(d))
for item in data:
self.process_changes(item)
return data
else:
raise SlackNotConnected
:Raises:
SlackNotConnected if self.server is not defined.
"""
# in the future, this should handle some events internally i.e. channel
# creation
if self.server:
json_data = self.server.websocket_safe_read()
data = []
if json_data != "":
for d in json_data.split("\n"):
data.append(json.loads(d))
for item in data:
self.process_changes(item)
return data
else:
raise SlackNotConnected