You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1005 B

use Shikiryu\Bot\Bot;
use Shikiryu\Bot\Commands\Lorem;
use Shikiryu\Bot\Commands\Tasks;
use Shikiryu\Bot\Commands\TasksList;
use Shikiryu\Bot\Commands\TasksProjects;
use Shikiryu\Bot\Commands\Youtubedl;
use Shikiryu\Bot\Request;
require 'vendor/autoload.php';
ini_set('log_errors', 1);
$config = include 'config.php';
$bot = new Bot($config);
$request = new Request($_POST);
if (!$bot->isValid($request)) {
// Give the bot something to listen for.
$bot->hears('(convertis|télécharges?) (https?:\/\/[^\s]+) en (audio|video|vidéo)', Youtubedl::class);
$bot->hears('lorem( ipsum)?', Lorem::class);
$bot->hears('liste.*projets?', TasksProjects::class);
$bot->hears('ajoute.*t(a|â)che (.*) dans "(.*)"', Tasks::class);
$bot->hears('(?:donne|liste).*t(?:a|â)ches? de "(.*)"', TasksList::class);
$bot->hears('(hello|hi|bonjour|salut)', function (Bot $bot) {
// Start listening