soroush-app / bot-php-sdk
Soroush Messenger Bot Wrapper for PHP
v1.0
2018-09-22 15:33 UTC
Requires
- php: >=5.6
- ext-curl: *
- ext-json: *
- guzzlehttp/guzzle: ~6.3
This package is auto-updated.
Last update: 2025-06-25 09:36:39 UTC
README
Soroush Messenger Bot Wrapper for PHP
Dependencies
- PHP 5.6+
- JSON Extension (php-json)
- cURL Extension (php-curl)
Installation
Run the below commands
git clone https://github.com/soroush-app/bot-php-sdk
cd bot-php-sdk
composer install
Usage
require dirname(__FILE__) . '/vendor/autoload.php'; $bot_token = 'your-bot-token'; $bot = new Soroush\Client($bot_token); try { $to = 'bot user id'; list($error, $success) = $bot->sendText($to, 'Sample text'); if($success) { echo 'Message sent successfully' . PHP_EOL; } else { echo 'Fail : ' . $error. PHP_EOL; } } catch (Exception $e) { die($e->getMessage()); }
More examples are in the examples folder.
Contribute
Contributions to the package are always welcome!
- Report any idea, bugs or issues you find on the issue tracker.
- You can grab the source code at the package's Git repository.