public static function init() { $allowed_actions = ['updateGetStartedButton', 'updateGreetingText', 'updatePersistentMenu']; $request = Request::getInstance(); $action = $request->getReceivedData('giga_action'); if ($action != null && in_array($action, $allowed_actions)) { @call_user_func([__CLASS__, $action]); } }
/** * Load the required resources * * @param $instance */ public function __construct($instance = null) { // Package Version if (!defined('GIGAAI_VERSION')) { define('GIGAAI_VERSION', '2.0.3'); } // Setup the configuration data $this->config = Config::getInstance(); if (!empty($config)) { $this->config->set($config); } // Make a Request instance. Not required but it will help user use $bot->request syntax $this->request = Request::getInstance(); // Make a Session instance. Not required but it will help user use $bot->session syntax $this->conversation = Conversation::getInstance(); // Load the storage $this->storage = new Storage(); // Load the model $this->model = new Model(); // We need to serialize Closure for dynamic data and intended actions $this->serializer = new Serializer(); // Boot the subscription feature $this->subscription = Subscription::getInstance(); }