Soroush Messenger Bot Wrapper for PHP
- PHP 5.6+
- JSON Extension (php-json)
- cURL Extension (php-curl)
Run the below commands
git clone https://github.com/soroush-app/bot-php-sdk
cd bot-php-sdk
composer install
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.
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.