コード例 #1
0
ファイル: weather_report.py プロジェクト: theoturner/rhizome
    def init(self, bot: ChatbotEngine):
        """

        :param bot:
        :return:
        """
        self.bot = bot
        self.logger = DotFlow2LoggerAdapter(
            logging.getLogger('df2_ext.weather'), self, self.bot, '$weather')
        bot.register_dotflow2_function('weather', {
            'object': self,
            'method': 'df2_weather'
        })
        bot.register_template_function('weather', {
            'object': self,
            'method': 'df2_weather'
        })
コード例 #2
0
    def init(self, bot: ChatbotEngine):
        """

        :param bot:
        :return:
        """
        self.bot = bot
        self.logger = DotFlow2LoggerAdapter(
            logging.getLogger('df2_ext.ssent_an'), self, self.bot,
            '$simpleSentimentAnalysis')
        bot.register_dotflow2_function('simpleSentimentAnalysis', {
            'object': self,
            'method': 'df2_simpleSentimentAnalysis'
        })
        bot.register_template_function('simpleSentimentAnalysis', {
            'object': self,
            'method': 'df2_simpleSentimentAnalysis'
        })
コード例 #3
0
ファイル: core_functions.py プロジェクト: theoturner/rhizome
    def init(self, bot: ChatbotEngine):

        self.bot = bot
        self.logger = DotFlow2LoggerAdapter(logging.getLogger('df2_ext.core'),
                                            self, self.bot, 'DF2CoreFnc')

        self.functions = [
            'input', 'eq', 'gt', 'lt', 'gte', 'lte', 'code', 'goto', 'return',
            'set', 'get', 'regexMatch', 'and', 'or'
        ]

        for f in self.functions:
            bot.register_dotflow2_function(f, {
                'object': self,
                'method': 'df2_' + f
            })
            bot.register_template_function(f, {
                'object': self,
                'method': 'df2_' + f
            })
コード例 #4
0
    def init(self, bot: ChatbotEngine):
        """
        Initializes extension

        :param bot:
        :return:
        """
        self.bot = bot
        self.logger = DotFlow2LoggerAdapter(
            logging.getLogger('df2_ext.r_output'), self, self.bot,
            'Output Response Ext')

        for f in self.functions:
            bot.register_dotflow2_function(f, {
                'object': self,
                'method': 'df2_' + f
            })
            bot.register_template_function(f, {
                'object': self,
                'method': 'df2_' + f
            })