PHP code example of amaxlab / skype-bot-sdk

1. Go to this page and download the library: Download amaxlab/skype-bot-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

amaxlab / skype-bot-sdk example snippets


$dataStorate = new \SkypeBot\Storage\FileStorage(sys_get_temp_dir());
$config = new \SkypeBot\Config(
    'YOUR SKYPE BOT ID',
    'YOUR SKYPE BOT SECRET'
);

$bot = \SkypeBot\SkypeBot::init($config, $dataStorate);

$bot->getNotificationListener()->setMessageHandler(
    function($payload) {
        file_put_contents(
            sys_get_temp_dir() . '/conversation_id.txt',
            $payload->getConversation()->getId();
        );
    }
);

$bot->getApiClient()->call(
    new \SkypeBot\Command\SendMessage(
        'Hello World.',
        'Your conversation id'
    )
);