reactbot.py 文件源码

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

项目:PantherBot 作者: PantherHackers 项目源码 文件源码
def connect_to_slack(self, token):
        # Initiates connection to the server based on the token, receives websocket URL "bot_conn"
        logger.info("Starting RTM connection")
        bot_conn = self.SLACK_CLIENT.api_call(
            "rtm.start",
            token = token
        )

        logger.info("Initializing info")
        self.initialize_info()

        # Creates WebSocketApp based on the URL returned by the RTM API
        # Assigns local methods to websocket methods
        logger.info("Initializing WebSocketApplication")
        self.WEBSOCKET = websocket.WebSocketApp(bot_conn["url"],
                                on_message=self.on_message,
                                on_error=self.on_error,
                                on_close=self.on_close,
                                on_open=self.on_open)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号