Exemple #1
0
 def get_bot_message_handler(self):
     # type: () -> Any
     # message_handler is of type 'Any', since it can contain any bot's
     # handler class. Eventually, we want bot's handler classes to
     # inherit from a common prototype specifying the handle_message
     # function.
     bot_module_path = os.path.join(current_dir, "bots", self.bot_name,
                                    self.bot_name + ".py")
     lib_module = get_lib_module(bot_module_path)
     return lib_module.handler_class()
Exemple #2
0
 def get_bot_message_handler(self):
     # type: () -> Any
     # message_handler is of type 'Any', since it can contain any bot's
     # handler class. Eventually, we want bot's handler classes to
     # inherit from a common prototype specifying the handle_message
     # function.
     bot_module_path = os.path.normpath(os.path.join(
         current_dir, '..', 'bots', self.bot_name, self.bot_name + '.py'))
     lib_module = get_lib_module(bot_module_path)
     return lib_module.handler_class()
Exemple #3
0
 def bot_to_run(self, bot_module):
     # Returning Any, same argument as in get_bot_message_handler function.
     # type: (str) -> Any
     lib_module = get_lib_module(bot_module)
     message_handler = lib_module.handler_class()
     return message_handler
Exemple #4
0
 def bot_to_run(self, bot_module):
     # type: None -> Function
     lib_module = get_lib_module(bot_module)
     message_handler = lib_module.handler_class()
     return message_handler