X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FTwitchBot%2FIRCMessage.php;h=89aa023a1230c2ca74ba108c315a72a8d5b88434;hb=b5a50d74cf042fa7fc874d8184dc37ae20bb74dd;hp=1e64bd9b6de7c12c0674ce7966e06adbd914f0b0;hpb=8fd3830c342ed7734280407b03cc7ced6e116b10;p=alttp.git diff --git a/app/TwitchBot/IRCMessage.php b/app/TwitchBot/IRCMessage.php index 1e64bd9..89aa023 100644 --- a/app/TwitchBot/IRCMessage.php +++ b/app/TwitchBot/IRCMessage.php @@ -195,6 +195,14 @@ class IRCMessage { return $this->command == 'PRIVMSG'; } + public function isOwner() { + return substr($this->getPrivMsgTarget(), 1) == $this->nick; + } + + public function isMod() { + return $this->isOwner() || (isset($this->tags['mod']) && $this->tags['mod'] == '1'); + } + public function makePong() { $msg = new IRCMessage(); $msg->command = 'PONG';