PHP code example of tzepart / botman-vk-driver

1. Go to this page and download the library: Download tzepart/botman-vk-driver 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/ */

    

tzepart / botman-vk-driver example snippets



namespace App\Conversation;

use VkBotMan\Model\AbstractConversation;

/**
 * Class EntryPointConversation
 */
class EntryPointConversation extends AbstractConversation
{
  //... logic your conversation
}


namespace App\Controller;

use App\Conversation\EntryPointConversation;
//...

class VkController extends AbstractController
{
    /**
     * @Route("/app/callback", methods={"POST"}, name="app_callback")
     * @param Request $request
     * @return Response
     */
    public function callback(
        Request $request
    )
    {
        $vkApiHandler = new VkApiHandler();
  
        $handler = new BotManHandler(
            $request,
            $vkApiHandler
        );

        $handler->attachConversation(new EntryPointConversation());

        return new Response();
    }
}