From 1a8ed65008de4db10255119dbf1893cd75509c4e Mon Sep 17 00:00:00 2001 From: DaisukeDaisuke <17798680+DaisukeDaisuke@users.noreply.github.com> Date: Mon, 5 Jul 2021 10:36:04 +0900 Subject: [PATCH] release 3.0.5 fixed #2 --- plugin.yml | 2 +- src/pmmpDiscordBot/pmmpDiscordBot.php | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) 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{