X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FTwitchBot%2FIRCMessage.php;h=4fb54c670b7a8890e89af029f6dc9b649efb42cc;hb=7fc357a5943bf280ce2fa9aa97ec516af61efd69;hp=1e64bd9b6de7c12c0674ce7966e06adbd914f0b0;hpb=98135a55c26ba5d485a0aa08aa4a3d1d42374cd9;p=alttp.git diff --git a/app/TwitchBot/IRCMessage.php b/app/TwitchBot/IRCMessage.php index 1e64bd9..4fb54c6 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';