Add BoopTextHandler
This commit is contained in:
@@ -24,7 +24,7 @@ class BeatHandler extends MessageHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class BlueRoomYiff extends MessageHandler
|
class BlueRoomYiffHandler extends MessageHandler
|
||||||
{
|
{
|
||||||
private $keywords = array ("nude", "จู๋", "yiff");
|
private $keywords = array ("nude", "จู๋", "yiff");
|
||||||
|
|
||||||
@@ -36,6 +36,7 @@ class BlueRoomYiff extends MessageHandler
|
|||||||
if(randomorg(0,1) < 1)
|
if(randomorg(0,1) < 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
$message = strtolower($message);
|
||||||
foreach ($this->keywords as $word) {
|
foreach ($this->keywords as $word) {
|
||||||
if(strpos($message, $word) !== false) {
|
if(strpos($message, $word) !== false) {
|
||||||
switch (randomorg(0,2)) {
|
switch (randomorg(0,2)) {
|
||||||
@@ -55,4 +56,29 @@ class BlueRoomYiff extends MessageHandler
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class BoopTextHandler extends MessageHandler
|
||||||
|
{
|
||||||
|
public function TryHandle($room_id, $msgid, $message, $room_lang): bool
|
||||||
|
{
|
||||||
|
$message = strtolower($message);
|
||||||
|
if(strpos($message, "boop") === false)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$this->sendSticker($room_id, "CAADBAADUwAD7Z8MDl38hfMCvM06Ag");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class OwOHandler extends MessageHandler
|
||||||
|
{
|
||||||
|
public function TryHandle($room_id, $msgid, $message, $room_lang): bool
|
||||||
|
{
|
||||||
|
if(preg_match("pattern", $message) === false)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$this->sendSticker($room_id, "CAADBAADUwAD7Z8MDl38hfMCvM06Ag");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,8 @@ require_once 'Handlers.php';
|
|||||||
|
|
||||||
$handlers = array(
|
$handlers = array(
|
||||||
new BeatHandler(),
|
new BeatHandler(),
|
||||||
new BlueRoomYiff()
|
new BlueRoomYiffHandler(),
|
||||||
|
new BoopTextHandler()
|
||||||
);
|
);
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user