Example #1
0
File: _307.php Project: nkreer/Fish
 public static function run(Command $command, Connection $connection, JsonConfig $config)
 {
     $user = User::getUserByNick($connection, $command->getArg(1));
     if ($user instanceof User) {
         $ev = new UserIdentifyEvent($user);
         $connection->getEventHandler()->callEvent($ev);
         if (!$ev->isCancelled()) {
             $config = IRC::getInstance()->getConfig();
             if ($config->getData("authentication_message", ["enabled" => true, "message" => "You have been identified."])["enabled"] === true) {
                 $user->sendNotice($config->getData("authentication_message")["message"]);
             }
             $user->identified = AuthenticationStatus::IDENTIFIED;
         }
     }
 }