]> git.localhorst.tv Git - alttp.git/blobdiff - app/TwitchBot/IRCMessage.php
actively ping IRC connection
[alttp.git] / app / TwitchBot / IRCMessage.php
index 00217dc044660b1a5b70c471a8f20497e611fad1..d127f9f5d57425e850512640d6ae470c2f0c1bc3 100644 (file)
@@ -132,6 +132,20 @@ class IRCMessage {
                return $msg;
        }
 
+       public static function part($channels) {
+               $msg = new IRCMessage();
+               $msg->command = 'PART';
+               $msg->params[] = implode(',', $channels);
+               return $msg;
+       }
+
+       public static function ping($token = 'localhorsttv') {
+               $msg = new IRCMessage();
+               $msg->command = 'PING';
+               $msg->params[] = $token;
+               return $msg;
+       }
+
        public static function privmsg($target, $message) {
                $msg = new IRCMessage();
                $msg->command = 'PRIVMSG';
@@ -162,6 +176,10 @@ class IRCMessage {
                return $this->command == 'PING';
        }
 
+       public function isPong() {
+               return $this->command == 'PONG';
+       }
+
        public function isPrivMsg() {
                return $this->command == 'PRIVMSG';
        }