Add owo handler

This commit is contained in:
2018-12-21 18:07:40 +00:00
parent 01225aecbd
commit 0e907d3af4
2 changed files with 3 additions and 2 deletions

View File

@@ -75,7 +75,7 @@ class OwOHandler extends MessageHandler
{ {
public function TryHandle($room_id, $msgid, $message, $room_lang): bool 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; return false;
$this->sendSticker($room_id, "CAADBAADUwAD7Z8MDl38hfMCvM06Ag"); $this->sendSticker($room_id, "CAADBAADUwAD7Z8MDl38hfMCvM06Ag");

View File

@@ -22,7 +22,8 @@ require_once 'Handlers.php';
$handlers = array( $handlers = array(
new BeatHandler(), new BeatHandler(),
new BlueRoomYiffHandler(), new BlueRoomYiffHandler(),
new BoopTextHandler() new BoopTextHandler(),
new OwOHandler()
); );
function reply_user(int $room_id, int $msgid, string $message, $room_lang): bool function reply_user(int $room_id, int $msgid, string $message, $room_lang): bool