Skip to content

Instantly share code, notes, and snippets.

@SOF3
Last active November 20, 2016 09:49
Show Gist options
  • Save SOF3/6cfc45f2cd123b03d4d2a2b422609c97 to your computer and use it in GitHub Desktop.
Save SOF3/6cfc45f2cd123b03d4d2a2b422609c97 to your computer and use it in GitHub Desktop.
<?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