]> git.localhorst.tv Git - alttp.git/blobdiff - app/TwitchBot/IRCMessage.php
add known bot
[alttp.git] / app / TwitchBot / IRCMessage.php
index d6cfaec2549886540bb8702f20edf41f1e50000d..b986847792f6898a4d99f8abb9a82f9455e55318 100644 (file)
@@ -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;
        }