X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FTwitchBot%2FIRCMessage.php;h=b986847792f6898a4d99f8abb9a82f9455e55318;hb=HEAD;hp=d6cfaec2549886540bb8702f20edf41f1e50000d;hpb=cb1131aef6b342429304ce3e3b92e4b3d700d494;p=alttp.git diff --git a/app/TwitchBot/IRCMessage.php b/app/TwitchBot/IRCMessage.php index d6cfaec..b986847 100644 --- a/app/TwitchBot/IRCMessage.php +++ b/app/TwitchBot/IRCMessage.php @@ -136,6 +136,17 @@ class IRCMessage { ]); } + public function tokenize() { + return TokenizedMessage::fromIRC($this); + } + + public static function capReq($cap) { + $msg = new IRCMessage(); + $msg->command = 'CAP REQ'; + $msg->params[] = $cap; + return $msg; + } + public static function join($channels) { $msg = new IRCMessage(); $msg->command = 'JOIN'; @@ -195,6 +206,10 @@ class IRCMessage { return $this->command == 'PRIVMSG'; } + public function isWhisper() { + return $this->command == 'WHISPER'; + } + public function isOwner() { return substr($this->getPrivMsgTarget(), 1) == $this->nick; }