예제 #1
0
 public function __construct($token, $bot_id)
 {
     parent::__construct($token, $bot_id);
     parent::registerHandler(EventBot::MEMBER_ADDED, array($this, "checkForAutoKick"));
     parent::registerHandler(EventBot::MEMBER_JOINED, array($this, "checkForAutoKick"));
     parent::registerHandler(EventBot::MEMBER_REJOINED, array($this, "checkForAutoKick"));
 }
예제 #2
0
 public function listen()
 {
     if (!$this->isSystemMessage() && $this->isCommandMessage()) {
         // Ignored?
         if ($this->isAuthorized($this->getPayload()['sender_id'])) {
             $command = $this->getCommand();
             $params = $this->getParams();
             if ($this->isRegisteredCommand($command)) {
                 $this->sendMessage($this->executeCommand($command, $params));
                 //echo $this->executeCommand($command);
             }
         }
     } else {
         parent::listen();
     }
 }
예제 #3
0
 public function __construct($token, $bot_id)
 {
     parent::__construct($token, $bot_id);
     parent::registerHandler(EventBot::MEMBER_ADDED, array($this, "onMemberAdded"));
 }