From 0e907d3af40ab2feb61d66d83f123d2fd0514425 Mon Sep 17 00:00:00 2001 From: Pitchaya Boonsarngsuk Date: Fri, 21 Dec 2018 18:07:40 +0000 Subject: [PATCH] Add owo handler --- src/Handlers.php | 2 +- src/entryPoint.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Handlers.php b/src/Handlers.php index 0af17da..6cfb253 100644 --- a/src/Handlers.php +++ b/src/Handlers.php @@ -75,7 +75,7 @@ class OwOHandler extends MessageHandler { public function TryHandle($room_id, $msgid, $message, $room_lang): bool { - if(preg_match("pattern", $message) === false) + if(preg_match('/^\s+[o0][wω][o0]\s+$/i', $message) === false) return false; $this->sendSticker($room_id, "CAADBAADUwAD7Z8MDl38hfMCvM06Ag"); diff --git a/src/entryPoint.php b/src/entryPoint.php index f6540ac..d556679 100644 --- a/src/entryPoint.php +++ b/src/entryPoint.php @@ -22,7 +22,8 @@ require_once 'Handlers.php'; $handlers = array( new BeatHandler(), new BlueRoomYiffHandler(), - new BoopTextHandler() + new BoopTextHandler(), + new OwOHandler() ); function reply_user(int $room_id, int $msgid, string $message, $room_lang): bool