Slackwolf\Message\Message::getText PHP 메소드

getText() 공개 메소드

public getText ( ) : mixed
리턴 mixed
    public function getText()
    {
        return $this->text;
    }

Usage Example

예제 #1
0
 /**
  * Does something. Not sure what the hell it is, though.
  *
  *
  * @return bool
  */
 public function input(Message $message)
 {
     $input = $message->getText();
     if (!is_string($input) || !isset($input[0]) || $input[0] !== '!') {
         return FALSE;
     }
     // [!kill, #channel, @name]
     $input_array = explode(' ', $input);
     // Remove "!" from first element of array and set to lowercase.
     $command = strtolower(substr($input_array[0], 1));
     $args = [];
     foreach ($input_array as $i => $arg) {
         if ($i == 0) {
             continue;
         }
         // Skip the command
         if (empty($arg)) {
             continue;
         }
         $args[] = $arg;
     }
     if ($command == NULL) {
         return FALSE;
     }
     try {
         /* @var \Slackwolf\Game\Command\Command $command */
         $command = CommandFactory::getCommand($command, $this->client, $this, $message, $args);
         $command->fire();
     } catch (Exception $e) {
         return FALSE;
     }
     return TRUE;
 }
All Usage Examples Of Slackwolf\Message\Message::getText