mqtt.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:mbot 作者: michaelkuty 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号