+ public function log() {
+ ChatLog::create([
+ 'command' => $this->command,
+ 'nick' => $this->nick,
+ 'params' => $this->params,
+ 'tags' => $this->tags,
+ ]);
+ }
+
+ public function tokenize() {
+ return TokenizedMessage::fromIRC($this);
+ }
+
+ public static function capReq($cap) {
+ $msg = new IRCMessage();
+ $msg->command = 'CAP REQ';
+ $msg->params[] = $cap;
+ return $msg;
+ }
+