public function run($name)
 {
     $name = trim(strtolower($name));
     if (!$name) {
         throw new \Exception('Devi specificare il nome del preferito da eliminare. Es. "/elimina casa"');
     }
     $fav = new Favourite($this->user(), $name);
     $fav->delete();
     $this->replyWithMessage('Preferito ' . $name . ' eliminato.');
 }
 public function run($name)
 {
     $name = trim(strtolower($name));
     if (!$name) {
         throw new \Exception('Devi specificare il nome del preferito da caricare. Es. "/carica casa"');
     }
     $fav = new Favourite($this->user(), $name);
     $fav->loadInSession();
     $this->replyWithMessage('Preferito ' . $name . ' (' . $fav->getDesc() . ') impostato correttamente.');
     $this->replyWithMessage($this->user()->getHint());
 }
 public function run($name)
 {
     $name = trim(strtolower($name));
     if (!$name) {
         throw new \Exception('Devi specificare un nome per il preferito. Es. "/salva casa"');
     }
     if (!$this->user()->hasSession()) {
         throw new \Exception($this->user()->getHint());
     }
     $fav = new Favourite($this->user(), $name);
     $fav->save();
     $this->replyWithMessage('Preferito ' . $name . ' salvato correttamente');
 }