Last active
November 20, 2016 09:49
-
-
Save SOF3/6cfc45f2cd123b03d4d2a2b422609c97 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SendMessageTask extends AsyncTask{ | |
public function __construct(PluginMain $mainClass, string $url){ | |
parent::__construct($mainClass); | |
$this->url = $url; | |
} | |
public function onRun(){ | |
$this->setResult(Utils::getURL($this->data)); | |
} | |
public function onCompletion(Server $server){ | |
$mainClass = $this->fetchLocal($server); | |
if($mainClass->isDisabled()) return; // IMPORTANT! | |
$mainClass->getMyFavouritePlayer()->sendMessage($this->getResult()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment