isValid($request)) { exit(1); } // 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) { $bot->replyPolitely('Bonjour'); }); // Start listening $bot->listen($_POST['text']);