]> git.localhorst.tv Git - alttp.git/blobdiff - app/TwitchBot/IRCMessage.php
basic twitch join/part commands
[alttp.git] / app / TwitchBot / IRCMessage.php
index c0acfbb547cc2d205fff7ef5420fdfbe07ce9ad1..c730ef7d0bfa962126417f7b513e7adc46984b9b 100644 (file)
@@ -132,6 +132,21 @@ class IRCMessage {
                return $msg;
        }
 
+       public static function part($channels) {
+               $msg = new IRCMessage();
+               $msg->command = 'PART';
+               $msg->params[] = implode(',', $channels);
+               return $msg;
+       }
+
+       public static function privmsg($target, $message) {
+               $msg = new IRCMessage();
+               $msg->command = 'PRIVMSG';
+               $msg->params[] = $target;
+               $msg->params[] = $message;
+               return $msg;
+       }
+
        public function getPrivMsgTarget() {
                if (!empty($this->params)) {
                        return $this->params[0];