Skip to content

Commit

Permalink
release 3.0.5
Browse files Browse the repository at this point in the history
fixed #2
  • Loading branch information
DaisukeDaisuke committed Jul 5, 2021
1 parent c6b693e commit 1a8ed65
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: pmmpDiscordBot
main: pmmpDiscordBot\pmmpDiscordBot
version: 1.0β
version: 3.0.5
api: 3.0.0
load: POSTWORLD
9 changes: 6 additions & 3 deletions src/pmmpDiscordBot/pmmpDiscordBot.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ 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();
}
), 10);

$this->getScheduler()->scheduleDelayedRepeatingTask(new ClosureTask(
function(int $currentTick): void{
function(int $currentTick) : void{
if(!$this->started) return;
$string = ob_get_contents();

Expand All @@ -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{
Expand Down

0 comments on commit 1a8ed65

Please sign in to comment.