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' })
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' })
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 })
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 })