Commit 695306ee authored by Stefano's avatar Stefano

Update SlapCommand.php

Code fixes
parent a63e8b5d
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
* *
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands;
use Longman\TelegramBot\Request; use Longman\TelegramBot\Request;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Command;
use Longman\TelegramBot\Entities\Update; use Longman\TelegramBot\Entities\Update;
...@@ -31,8 +32,10 @@ class SlapCommand extends Command ...@@ -31,8 +32,10 @@ class SlapCommand extends Command
$sender='@'.$message->getFrom()->getUsername(); $sender='@'.$message->getFrom()->getUsername();
//username validation //username validation
$test=preg_match('/@[\w_]{5,}/',$text); $test=preg_match('/@[\w_]{5,}/', $text);
if($test===0) return false; if ($test===0) {
return false;
}
$data = array(); $data = array();
$data['chat_id'] = $chat_id; $data['chat_id'] = $chat_id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment