Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //before this make sure you did a composer requre...
- require 'vendor/autoload.php';
- use BotMan\BotMan\BotMan;
- use BotMan\BotMan\BotManFactory;
- $config = [
- // Your driver-specific configuration
- // "telegram" => [
- // "token" => "TOKEN"
- // ]
- ];
- // Load the driver(s) you want to use
- DriverManager::loadDriver(\BotMan\Drivers\Telegram\TelegramDriver::class);
- // Create an instance
- $botman = BotManFactory::create($config);
- // Give the bot something to listen for.
- $botman->hears('hello', function (BotMan $bot) {
- $bot->reply('Hello yourself.');
- });
- // Start listening
- $botman->listen();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement