unreal4u / telegram-api

Complete async capable Telegram bot API implementation for PHP7
https://github.com/unreal4u/telegram-api/wiki
MIT License
793 stars 174 forks source link

Don't understand whats wrong #111

Closed yiulcheng3 closed 4 years ago

yiulcheng3 commented 5 years ago

i have followed up all your installation instuction at the page and typen the basic usage in a .php file in my project folder <?php include('vendor/autoload.php');

use \unreal4u\TelegramAPI\HttpClientRequestHandler; use \unreal4u\TelegramAPI\TgLog; use \unreal4u\TelegramAPI\Telegram\Methods\SendMessage;

$loop = \React\EventLoop\Factory::create(); $handler = new HttpClientRequestHandler($loop); $tgLog = new TgLog(BOT_TOKEN, $handler);

$sendMessage = new SendMessage(); $sendMessage->chat_id = A_USER_CHAT_ID; $sendMessage->text = 'Hello world!';

$tgLog->performApiRequest($sendMessage); $loop->run();

?>

and when i open this .php through my browser it turns up Parse error: syntax error, unexpected ':', expecting '{' in /Applications/XAMPP/xamppfiles/htdocs/hook/vendor/amphp/amp/lib/functions.php on line 21

unreal4u commented 5 years ago

Hi!

Please ensure you are at least using php v7.0 for this library.

Greetings.

unreal4u commented 4 years ago

Closing this question due to inactivity. If you have any further questions feel free to reopen or create a new issue.

Thanks.