def mqtt(self):
"""Returns slack client"""
if not hasattr(self, "client"):
try:
import paho.mqtt.client as mqtt
except ImportError:
install_package("paho-mqtt")
import paho.mqtt.client as mqtt
self.client = mqtt.Client()
self.client.on_connect = on_connect
self.client.on_message = on_message
self.client.mbot = self.bot
self.client.backend = self
return self.client
评论列表
文章目录