Skip to content

Commit

Permalink
Add getGroup() to multi
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadyita committed Mar 3, 2024
1 parent 0709034 commit 90d1c68
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Client/Multi.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use function Amp\{async, delay};

use Amp\Pipeline\{ConcurrentIterator, Queue};
use AO\{Package, Parser, Utils};
use AO\{Group, Package, Parser, Utils};
use Closure;
use InvalidArgumentException;
use Nadylib\LeakyBucket\LeakyBucket;
Expand Down Expand Up @@ -64,6 +64,17 @@ public function __construct(
}
}

/**
* Get infomation about a public group we're in
*
* @param string|Group\Id $id the name or id of the group
*
* @return Group|null Information about the group, or NULL, if we're not in it
*/
public function getGroup(string|Group\Id $id): ?Group {
return $this->getBestWorker()?->getGroup($id);
}

public function isReady(): bool {
return $this->isReady;
}
Expand Down

0 comments on commit 90d1c68

Please sign in to comment.