diff --git a/plugin.yml b/plugin.yml index 291328e..140534c 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,5 +1,5 @@ name: pmmpDiscordBot main: pmmpDiscordBot\pmmpDiscordBot -version: 1.0β +version: 3.0.5 api: 3.0.0 load: POSTWORLD diff --git a/src/pmmpDiscordBot/pmmpDiscordBot.php b/src/pmmpDiscordBot/pmmpDiscordBot.php index 13a4880..431eda8 100644 --- a/src/pmmpDiscordBot/pmmpDiscordBot.php +++ b/src/pmmpDiscordBot/pmmpDiscordBot.php @@ -74,7 +74,7 @@ public function onEnable(){ unset($token); $this->getScheduler()->scheduleDelayedTask(new ClosureTask( - function(int $currentTick): void{ + function(int $currentTick) : void{ $this->started = true; $this->getLogger()->info("出力バッファリングを開始致します。"); ob_start(); @@ -82,7 +82,7 @@ function(int $currentTick): void{ ), 10); $this->getScheduler()->scheduleDelayedRepeatingTask(new ClosureTask( - function(int $currentTick): void{ + function(int $currentTick) : void{ if(!$this->started) return; $string = ob_get_contents(); @@ -93,9 +93,12 @@ function(int $currentTick): void{ ), 10, 1); $this->getScheduler()->scheduleDelayedRepeatingTask(new ClosureTask( - function(int $currentTick): void{ + function(int $currentTick) : void{ foreach($this->client->fetchMessages() as $message){ $content = $message["content"]; + if($content === ""){ + continue; + } if($content[0] === "/"){ Server::getInstance()->dispatchCommand(new ConsoleCommandSender(), substr($content, 1)); }else{