classes/RPGRollerBot.php
/**
	 * Parse the input data
	 *
	 * @throws Exception
	 */
Parse the input data
@throws Exception
Parse the input data @throws Exception
private function parseData(){
		$update = json_decode($this->input, true);
		if(!$update){
			throw new Exception('No data');
		}
		$this->message = isset($update['message']) ? $update['message'] : "";
		$this->messageId = isset($this->message['message_id']) ? $this->message['message_id'] : "";
		$this->chatId = isset($this->message['chat']['id']) ? $this->message['chat']['id'] : "";
		$this->firstname = isset($this->message['chat']['first_name']) ? $this->message['chat']['first_name'] : "";
		$this->lastname = isset($this->message['chat']['last_name']) ? $this->message['chat']['last_name'] : "";
		$this->username = isset($this->message['chat']['username']) ? $this->message['chat']['username'] : "";
		$this->date = isset($this->message['date']) ? $this->message['date'] : "";
		$this->text = isset($this->message['text']) ? $this->message['text'] : "";
		$this->text = trim($this->text);
		$this->text = strtolower($this->text);
	}
private function parseData ( ) { $ update = json_decode ( $ this -> input , true ) ; if ( ! $ update ) { throw new Exception ( 'No data' ) ; } $ this -> message = isset ( $ update [ 'message' ] ) ? $ update [ 'message' ] : " " ; $ this -> messageId = isset ( $ this -> message [ 'message_id' ] ) ? $ this -> message [ 'message_id' ] : " " ; $ this -> chatId = isset ( $ this -> message [ 'chat' ] [ 'id' ] ) ? $ this -> message [ 'chat' ] [ 'id' ] : " " ; $ this -> firstname = isset ( $ this -> message [ 'chat' ] [ 'first_name' ] ) ? $ this -> message [ 'chat' ] [ 'first_name' ] : " " ; $ this -> lastname = isset ( $ this -> message [ 'chat' ] [ 'last_name' ] ) ? $ this -> message [ 'chat' ] [ 'last_name' ] : " " ; $ this -> username = isset ( $ this -> message [ 'chat' ] [ 'username' ] ) ? $ this -> message [ 'chat' ] [ 'username' ] : " " ; $ this -> date = isset ( $ this -> message [ 'date' ] ) ? $ this -> message [ 'date' ] : " " ; $ this -> text = isset ( $ this -> message [ 'text' ] ) ? $ this -> message [ 'text' ] : " " ; $ this -> text = trim ( $ this -> text ) ; $ this -> text = strtolower ( $ this -> text ) ; }
Parse the input data
 @throws Exception
Parse the input data @throws Exception