Advertisement
Guest User

bot.php

a guest
Jan 21st, 2018
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <?php
  2. //before this make sure you did a composer requre...
  3.  
  4. require 'vendor/autoload.php';
  5. use BotMan\BotMan\BotMan;
  6. use BotMan\BotMan\BotManFactory;
  7.  
  8. $config = [
  9. // Your driver-specific configuration
  10. // "telegram" => [
  11. // "token" => "TOKEN"
  12. // ]
  13. ];
  14.  
  15. // Load the driver(s) you want to use
  16. DriverManager::loadDriver(\BotMan\Drivers\Telegram\TelegramDriver::class);
  17.  
  18. // Create an instance
  19. $botman = BotManFactory::create($config);
  20.  
  21. // Give the bot something to listen for.
  22. $botman->hears('hello', function (BotMan $bot) {
  23. $bot->reply('Hello yourself.');
  24. });
  25.  
  26. // Start listening
  27. $botman->listen();
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement