]> git.localhorst.tv Git - alttp.git/blobdiff - app/TwitchBot/IRCMessage.php
update muffins tracker
[alttp.git] / app / TwitchBot / IRCMessage.php
index 4fb54c670b7a8890e89af029f6dc9b649efb42cc..d6cfaec2549886540bb8702f20edf41f1e50000d 100644 (file)
@@ -35,7 +35,7 @@ class IRCMessage {
                        $has_host = false;
                        $prefix = explode(' ', $processed, 2);
                        $processed = $prefix[1];
-                       $prefix = ltrim($prefix[0], ':');
+                       $prefix = $prefix[0][0] === ':' ? substr($prefix[0], 1) : $prefix[0];
                        if (strpos($prefix, '!') !== false) {
                                $has_user = true;
                        }
@@ -67,7 +67,7 @@ class IRCMessage {
 
                while (strlen($processed)) {
                        if ($processed[0] == ':') {
-                               $msg->params[] = ltrim($processed, ':');
+                               $msg->params[] = substr($processed, 1);
                                break;
                        }
                        $e = explode(' ', $processed, 2);
@@ -200,7 +200,7 @@ class IRCMessage {
        }
 
        public function isMod() {
-               return $this->isOwner() || (isset($this->tags['mod']) && $this->tags['mod'] = '1');
+               return $this->isOwner() || (isset($this->tags['mod']) && $this->tags['mod'] == '1');
        }
 
        public function makePong() {