bot.py 文件源码

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

项目:demo.slackbot 作者: SynapseFI 项目源码 文件源码
def execute_command(self, command, slack_id, params, channel):
        """Attempt to run the command with the parameters provided."""
        self.acknowledge_command(channel)
        synapse_user = self.synapse_user_from_slack_user_id(slack_id)
        response = self.registration_prompt(slack_id)

        if synapse_user:
            try:
                response = command(slack_id, synapse_user, params)
            except SynapsePayError as e:
                response = (
                    'An HTTP error occurred while trying to communicate with '
                    'the Synapse API:\n{0}'.format(e.message)
                )
            except Exception as e:
                traceback.print_tb(e.__traceback__)
                response = 'An error occurred:\n{0}: {1}'.format(
                    sys.exc_info()[0],sys.exc_info()[1]
                )
        return response
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号