Skip to content

Instantly share code, notes, and snippets.

@mpociot
Created March 14, 2018 13:49
Show Gist options
  • Select an option

  • Save mpociot/e0d3be6b84ac4664a40c8c4b9810b6cc to your computer and use it in GitHub Desktop.

Select an option

Save mpociot/e0d3be6b84ac4664a40c8c4b9810b6cc to your computer and use it in GitHub Desktop.
<?php
use React\EventLoop\Factory;
use BotMan\BotMan\BotManFactory;
use BotMan\BotMan\Cache\ArrayCache;
use BotMan\BotMan\Drivers\DriverManager;
use BotMan\Drivers\Slack\SlackRTMDriver;
$loop = Factory::create();
// Do stuff with $loop
$loop->addPeriodicTimer(60, function () use ($botman) {
$timeout = 2.0;
$botman->getClient()->checkConnection($timeout);
});
DriverManager::loadDriver(SlackRTMDriver::class);
return BotManFactory::createForRTM($config, $loop, new ArrayCache());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment