import scala.util.control.Exception.allCatch package object bot { implicit class OptionInt(s: String) { def toOptInt: Option[Int] = s match { case "" => None case _ => allCatch.opt(s.toInt) } } }